JS Object in header Script tag is reloaded on every page, logs error | XM Community
Skip to main content

I have loaded in a large javascript object from a script tag in my survey header. However, my console displays ‘Uncaught SyntaxError: Identifier 'abc' has already been declared (at abc.js:1:1)’ 

 

I thought that the JFE would only load this header once, but it seems to be reloading it on every page transition - how do I fix this?

The header will load on every page, there’s no fix for it.

If you want the script only on one page, you could load it using javascript:

Qualtrics.SurveyEngine.addOnload(function () {
jQuery.getScript("SCRIPT URL")
});

 


Leave a Reply