This function gives me the following error:
SyntaxError: Invalid character ‘\u8203’
All looks good to me,
function changeColumnWidth() {
var w = Math.random() * 200+80;
$('#menu').css("width", w+"px");
}
can someone spot the error?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s a character after the closing curly brace:
I copy-pasted your code in Firefox’ console, postfixed with a undefined method invocation:
A TypeError (undefined) shows up, which includes the parsed (escaped) code:
TypeError: "function changeColumnWidth() { var w = Math.random() * 200+80; $('#menu').css(\"width\", w+\"px\");}\u200B".l is not a function.^^^^^^ Here’s the error.
Now, the troublemaker is found. To fix it, open your code in a text editor, and remove the invisible character. This character can be detected by walking through all characters using the arrow keys.