Qualtrics survey engine appears to be running twice (at least in preview) | XM Community
Skip to main content

This behaviour has been fouling a more complicated survey, so I tried with only a single question. I have added javascript to my questions as follows:
Screenshot 2023-01-18 at 7.11.59 PM.pngEach of these functions appears to be getting called twice in preview mode. Here's what the console looks like:
Screenshot 2023-01-18 at 7.11.11 PM.pngSo OnLoad then On read is run (x2) then onunload (x2).
This means that any variables that I'm assigning are getting cleared null and causing major complications with my more complicated survey. This behaviour just doesn't seem kosher - any ideas on what's happening? I think it might be a JTE thing?
Regards,
Jesse

It does that in preview. Once for the desktop and once for the mobile preview.
Doesn't happen when published.


Since there is modile view along with desktop view in preview link. That's why each function is appearing twice.


How to I get it to only preview desktop or mobile? it's causing major issues in debugging my code and I'm not sure it will work.
not accepted answer, but I don't know how to remove it


Publish. Use the anonymous link to test.


Yes, use anonymous link. Do not complete your test run while debugging your code and delete all partial response after each test run.


Leave a Reply