I want to create a variable that would allow me record whether the subject navigated away from the survey page. I have the following code, but for some reason it does not work as I am hoping.. any ideas on how i can get it to work? Thanks so much!
var onpage=0;
function checkPageFocus() {
if (document.hasFocus()==true) {
}
else {
onpage=1;
Qualtrics.SurveyEngine.setEmbeddedData("onpage", onpage);
}
}
setInterval(checkPageFocus, 1000);
Be the first to reply!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.