Is there any reason this JavaScript wouldn't work for survey participants using Safari? | XM Community
Skip to main content

I have some JavaScript set to automatically open a new tab displaying a PDF for some blocks in my survey, which automatically closes when the participant moves to the next block. In testing, it works fine for anyone not using Safari (Chrome on MacOS works fine). Does anyone have any idea as to why, and if there is a way for it to work on Safari?
Thanks!
The code is:
var myWindow;

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

});

Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/

myWindow = window.open("PDF_URL");


});

Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
myWindow.close();

});

Leave a Reply