Using Javascript to pass variables via a url Feb 26, 2014 By Karessa Torgerson 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);
Scott Wiley over 4 years ago09/16/19 at 5:45 pm (UTC) 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;
Scott Wiley over 4 years ago09/16/19 at 5:46 pm (UTC) Note: when I posted into code field, it got rid of the double quotes around the URL.
2 Replies
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:
Note: when I posted into code field, it got rid of the double quotes around the URL.
This discussion is closed. You can start a new discussion or contact Articulate Support.