SyntaxError: missing) after argument list in fire error

I get a syntax error:

SyntaxError: none) after argument list

From this jQuery code:

$("#createEnquiry").text(${noEnqMsg});

What errors cause a Javascript syntax error ?

+4
source share
2 answers

I think you wanted to use string quotes:

$("#createEnquiry").text("${noEnqMsg}");

Or maybe you, although you used pattern strings :

$("#createEnquiry").text(`${noEnqMsg}`);
+5
source

You may need to use the template strings as indicated in the code instruction below

$("#createEnquiry").text(`${noEnqMsg}`);

ES6. ES5. , ES6 , . Chrome, Firefox. .

ES6

+2

All Articles