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