About Document.All.Item encountered IE8 when the data is not properly taken

Source: Internet
Author: User

Recently found in the project encountered such a situation, the previous system under the IE6 is good, but in IE8 some input boxes appear in the data can not get, and later found that there are many expressions in IE8 is not available, including now said Documen.all.item () Get the object is always empty, After careful collection of information, it was found that the DOCTYPE

When you click the button, will the text box be assigned a value?
If you use IE6, I can tell you for sure, will ...
But if you open it with a IE8, it's definitely not.
You can try it if you don't believe it.
There are two solutions, one is to add a sentence before DOCTYPE <!----->
The other is to annotate doctype or remove them. The effect of these two methods is the same, why?
Before doctype the comment block, you can suppress the function of DOCTYPE, because DOCTYPE must be in the first line of HTML, the second line loses its meaning, the second method is needless to say.
If you have the same problem, you can check your JSP, it is likely that you doctype in the JSP is not written in the first line, but you look at the source file, it is likely that doctype in the first line appears, so we will be careful to write HTML later.
Why add DOCTYPE do not support it, first document.all.item itself is not the standard, but a Microsoft made a set of things, now Microsoft want to IE8 in the maintenance of this, so it does not support now.
So we have to write a program later must use the standard, with Document.getelementsbyname () [0] instead of it
。 Believe that this will not be unsupported.

About Document.All.Item encountered IE8 when the data is not properly taken

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.