Hello, I am testing out the JavaScript interface in Chrome/Firefox and when I run player.GetVar("name") I always get an empty string, even though I edited the field on the screen. When I player.GetVar("notarealvar") it says null instead of "", so it seems like I am hitting _some_ kind of variable, it is just not updated when I edit the text field on the screen?
Do I have to finish the whole quiz, or write special code to copy the data from the text field into vars that will be available from JavaScript?
You'll want to be sure you're testing the published output within the intended environment, as testing it locally could cause elements such as the Javascript triggers to fail. You'll find some additional best practices and information on using Javascript here.
Hello, I am testing out the JavaScript interface in Chrome/Firefox and when I run player.GetVar("name") I always get an empty string, even though I edited the field on the screen. When I player.GetVar("notarealvar") it says null instead of "", so it seems like I am hitting _some_ kind of variable, it is just not updated when I edit the text field on the screen?
Do I have to finish the whole quiz, or write special code to copy the data from the text field into vars that will be available from JavaScript?
Thanks.
Jason,
I am not a coder, but i play around a little bit here and there. Can u tell me what are your objectives of this exercise, and how are u doing it.
2 Replies
Hi Jason and welcome to Heroes!
You'll want to be sure you're testing the published output within the intended environment, as testing it locally could cause elements such as the Javascript triggers to fail. You'll find some additional best practices and information on using Javascript here.
Jason,
I am not a coder, but i play around a little bit here and there. Can u tell me what are your objectives of this exercise, and how are u doing it.
Regards,
Kawstov
This discussion is closed. You can start a new discussion or contact Articulate Support.