/    Sign up×
Community /Pin to ProfileBookmark

link to new win & pass cookie val in querystring.

WebCT forces the following new window link formatting:
onclick=”if (! top.in_designer_mode()) { top.doWindowOpen(‘http://www.someurl.com/students/chats/roster.asp?uid=document.cookie.WebCTTicket.username‘, ‘new_frame’, ‘width=730,height=414,menubar=1,toolbar=1,scrollbars=1,status=1,location=1,resizable=1’, 0); } else { void(top.update_breadcrumb(‘test pass querystring to new win’, ”, ‘/SCRIPT/RAD_Orientation/scripts/designer/serve_home?1008260903+edit+1008265122+REORG+1008265122+1’, 0, 1, 1, 0));} return false;”

I use their text box to supply the URL of the link I want their page to point to, eg. http://www.someurl.com/students/chats/roster.asp, and they auto format the new window opener.

I need to pass the username value of their login cookie in the querystring of the above url something like so:
?uid=’+document.cookie.WebCTTicket.username+

Trouble is that they format the new window opener for me as described above with apostrophes and break my link. It ends up being:
top.doWindowOpen(‘http://www.someurl.com/students/chats/roster.asp?uid=’+document.cookie.WebCTTicket.username+’, ‘new_frame’, ‘width=730,height=414,menubar=1,toolbar=1,scrollbars=1,status=1,location=1,resizable=1’, 0). Everything after the uid= is ignored because my apostrophe becomes the end of the URL string.

I want the uid variable in my querystring to hold the username value of their WebCTTicket cookie, but don’t know how to get it in there. Do I need to escape the apostrophe sonehow (I tried and failed)?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @canuck spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...