Unable to use Javascript async? | XM Community
Skip to main content

I am trying to add custom javascript to a survey question. When I try to put the following code into the java script editor, I receive the warning "Invalid JavaScript! You cannot save until you fix all errors: Unexpected token function". Removing the "async" keyword allows me to successfully save the code. Why can't I use async?

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
async function hello() { return "Hello" };
hello();
});

Maybe because async is not supported in IE11?


Leave a Reply