开发者

Where does the "item" object come from in javaScript

开发者 https://www.devze.com 2023-01-08 04:20 出处:网络
Messing with some javaScript, I found that the variable name \"item\" was already being assigned before I declared it or assigned anything to it.Tracing it backwards, I found that it even seemed defin

Messing with some javaScript, I found that the variable name "item" was already being assigned before I declared it or assigned anything to it. Tracing it backwards, I found that it even seemed defined before I did ANYTHING in js. To verify this, I even put

&开发者_StackOverflowlt;script>alert(item);</script>

on a line by itself IMMEDIATELY after opening the HEAD tag - upon loading the page, I get an alert box with the following:

"[object]"

If I do the same thing in FF, I get an error, saying that "item" is not defined.

Where is "item" coming from in IE?


Check this out >> "item" is a reserved keyword in IE

0

精彩评论

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