Javascript not incrementing embedded data | XM Community
Question

Javascript not incrementing embedded data


Badge
a

2 replies

Userlevel 7
Badge +27
Have you looked at the browser console to see if there are any errors?

You need to declare your variables (e.g. `var choices = [];`). It's a bit surprising that the first script worked.

You need to change addOnload to addOnReady or else hiding the buttons probably won't work

You aren't using jQuery, so switching to jQuery would cause errors unless you modified to code. The $ in Qualtrics refers to prototypejs, not jQuery.
Badge
Hi Tom. Thank you so much for getting back to me. I really appreciate it. I have changed it to addOnReady and declared the variables. I think the variables could be defined without the keyword 'var', but this risks confusion with global variables.

The code still doesn't work. In the Java console I get the following messages:

{"status":"Unauthenticated","message":"invalid xsrf token","setupCompleted":false}

[dom] Found 2 elements with non-unique id #T: (More info: https://goo.gl/9p2vKq) <input type=​"hidden" id=​"T" name=​"T" value=​"48O5LuDEkV6AAuAu0KMzV3">​ <input type=​"hidden" id=​"T" name=​"T" value=​"48O5LuDEkV6AAuAu0KMzV3">​
appcommons.min.js:34

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

And lots of the following:

Translation key not found Object
r @ appcommons.min.js:1

Any idea what these mean? Thank you!!!

Leave a Reply