player.GetVar("varname") returns empty string ("")

Feb 17, 2014

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.

2 Replies
Kawstov FLIP

Jason Livesay said:

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. 

Regards,

Kawstov

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