I was using JSLint to validate my code and i received the following error:
"expecting </ instead of <\"
I got that for my HTML code and JavaScript code. For example:
element.innerHTML += "<p>here's what happened: You are <b>" + aVariable + " </b> years old.</p>";
and:
<input type="text" name="enterText" id="nameOfPerson" onblur="submitValues(this)" size="50" value="Enter you开发者_Go百科r name"/>
Can anyone tell me why this is happening?
In the JSLint section on HTML, it says:
JSLint also checks for the occurrence of '</' in string literals. You should always write '</' instead. The extra backslash is ignored by the JavaScript compiler but not by the HTML parser. Tricks like this should not be necessary, and yet they are.
精彩评论