Using Javascript to pass variables via a url

Feb 26, 2014

I have the following code in a little javascript function set to execute when the timeline of a screen ends. When the timeline ends, nothing happens. No window opens! Can anyone say what I'm doing wrong? Thank you!

var urlString='https://www.mysite.com/CompleteCourse/PostCompletedCourse?account=%25externalOrganization%25&firstname=%25externalFirstName%25&lastname=%25externalLastName%25;

window.open(urlString);

2 Replies
Scott Wiley

I see a couple of things.

Your code might work as is by just closing your text variable value with another single quote ('), or enclosing with two double quotes (").

Another thing you could try is removing the "%25" which is probably causing issues. Use an ampersand (&) to add each additional variable/value pair.

Example:

var urlString = https://www.mysite.com/CompleteCourse/PostCompletedCourse?variable_1=value_1&variable_2=value_2&variable_3=value_3;

This discussion is closed. You can start a new discussion or contact Articulate Support.