This article describes the solution to the JS prompt: Uncaught SyntaxError: Unexpected token ILLEGAL error. Share it for your reference, as follows:
Uncaught SyntaxError: Unexpected token ILLEGAL
Uncaught Syntax Error: Unexpected Illegal Token
As shown in the figure below:
Copy the code as follows:<input id="btn_0_4EAE4F474C91156086C0D4EA7E983C69C215B649" type="button" value="connect" onclick="middleware_connect(0, 4EAE4F474C91156086C0D4EA7E983C69C215B649)">
After checking the source code, you can find:
onclick="middleware_connect(0, 4EAE4F474C91156086C0D4EA7E983C69C215B649)"
The second parameter is a string, but is not enclosed in quotes, so this exception is raised.
After adding quotes, the problem is solved:
Copy the code as follows:<input id="btn_0_4EAE4F474C91156086C0D4EA7E983C69C215B649" type="button" value="connect" onclick="middleware_connect('0', '4EAE4F474C91156086C0D4EA7E983C69C215B649')">
For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript Errors and Debugging Skills", "Summary of JavaScript value transfer operation skills", "Summary of JavaScript encoding operation skills", "Summary of json operation skills in JavaScript", "Summary of JavaScript switching effects and techniques", "Summary of JavaScript search algorithm skills", "Summary of JavaScript animation effects and techniques", "Summary of JavaScript data structures and algorithm skills", "Summary of JavaScript traversal algorithms and techniques" and "Summary of JavaScript mathematical operation usage"
I hope this article will be helpful to everyone's JavaScript programming.