I am working on a very old web app which uses document.all.item to iterate through the dom and
it is causing runtime errors when i deploy the application in localhost and the error dissapears when i deploy it on server outside my machine. Below os the code where it throws the unknown runtime error. what is the reason or how can i go about resolving it?
with(document.all)
item('fieldName').innerHTML = "Blah Blah"; // Error is on this line.?
}
When i tried to debug in IE. I can access the item but cannot access the innerHTML for some reason. Is it because of IE or something else?
On Google Chrome,
HTMLAllCollection(The result fromdocument.all) has noitemproperty. I’d suggest looping through them with anforloop:The behaviour change might be because of inconsistent implementation of a
itemproperty onHTMLAllCollections, where IE apparently does implement it, and your server doesn’t.