Recently in doing a Personal Homepage blog site project, encountered this problem.
When the browser is prompted with the error "Uncaught syntaxerror:unexpected token <", the browser will not normally be able to accurately mark where the error occurred, and the browser will usually mark it in the top line of the page, i.e.
This error is actually caused by the use of outdated (deprecated) JavaScript tag statements.
As an example:
1 < src= "#" language= "JavaScript">2 < !---3</script>
The above code snippet uses outdated and deprecated tag attributes language= "JavaScript", so the JS does not execute correctly, the browser prompts the error "Uncaught syntaxerror:unexpected token <".
The code snippet should be changed to the recommended way Type= "Text/javascript":
1 < type= "Text/javascript">2 <!---- >3</script>
Record a bit, share the wonderful, with careful and patience to overcome the inner fear!
JSP page Error: "Uncaught syntaxerror:unexpected token <"