Ajax in the operation of the DOM depressed for several days, today finally understand, self-study is bitter ah, bitter a runny nose a tear, the lesson to come out, give a wake up, veteran will not look.
The operation of XML in 1.DOM does not mix with the browser, for example, Getelementbyname is the DOM operation of the built-in document object in the browser. It is wrong for you to operate responsexml. In the browser, you can use Document.getelementsbyname (' tagname ') [0].value to get the value of the control, but in the operation Responsexml you have to use Getelementsbyname (' tagname ') [0].firstchild.data (NodeValue).
2. If you want to apply Responsexml, then you should write the Response.setcontenttype ("Text/xml") on the server's answering service.
If your AJAX code doesn't pass one at a time, the page may still be wrong, even after you change it correctly, and this is caused by a nasty browser cache.
The evils of the cache, I have been delayed here for at least 1 days
So you'd better write a statement on the server Answer page that prohibits caching response.setheader ("Cache-control", "No-cache");
(the number of milliseconds after the request URL + The current system is also a method.) In JS, use the new Date (). GetTime () to get the millisecond difference between the system and a specific time. ).
3. Because some of the current IE standards do not fully conform to the international consortium. For example:
Monitoring control changes We all know the onchange event, but for the text control IE does not support onchange properties, fortunately we onpropertychange event to listen for text.
Again, we can use Setatrribute () to set CSS properties in browsers other than IE, but not in IE, and we use Eobj.style.stylearrtibute=value to implement them.
<