normally, when I write a javascriptkey, there is a difference between the client and the zookeeper Doc ument. In actual use, there are no problems, but this poses a huge risk. When a problem occurs, this bug becomes very difficult to find.
Code :
test1.jsp:
test1.jsp </ title>
Test2.jsp:
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML>
<Head>
<Title> test2.jsp </title>
</Head>
<Script language = 'javascript '>
Function Showa (){
Alert (document. getelementbyid ('input2'). value );
}
Function showb (){
Alert(registry.doc ument. getelementbyid ('input2'). value );
}
</SCRIPT>
<Body>
<Input id = 'input2' type = 'text' name = 'name2' value = 'ph2'/> <br>
<Input type = 'button 'name = 'butt1' value = 'showa () 'onclick = 'javascript: Showa ();'/> <br>
<Input type = 'button 'name = 'butt2' value = 'showb () 'onclick = 'javascript: showb ();'/> <br>
</Body>
</Html>
Is Showa () different from showb? Most machines do not have them, but they still exist. Today I met them. A user youxing told me that showb () on his notebook would have an error. (The operating system, browser version, and settings are the same. It's strange !)
Question: When test2.jspis in iframe, does the temporary Doc ument refer to the document in IFRAME or the document outside?
Therefore, the blog reminds you that you can omit window.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/rekcah_ph/archive/2005/08/30/467859.aspx