开发者

JSLint message: "expecting expecting <\/ instead of <\ " -What is the reason(s) for that error?

开发者 https://www.devze.com 2022-12-22 08:15 出处:网络
I was using JSLint to validate my code and i received the following error: \"expecting </ instead of <\\\"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消