sazzie Posted January 9, 2007 Share Posted January 9, 2007 My Ajax application has stalled because Firefox responds to my innerHtml call but explorer doesn't.My code is as follows : [code][color=red]var xmlDoc = request.responseXML;var emailTag = xmlDoc.getElementsByTagName("email")[0];var textOut = emailTag.firstChild.nodeValue; document.getElementById(div_handler.divTag).innerHTML = textOut; //document.getElementById("div1").appendData(textOut); //document.appendData(textOut);[/color][/code]I tried using the DOM in the 2 last lines of code. I am sure one of them is wrong but the surprise is I can't getthe DOM to update my web page in either case.Can someone please advice how to use the DOM to update my divs?thanks :) Quote Link to comment Share on other sites More sharing options...
Zeon Posted January 10, 2007 Share Posted January 10, 2007 it depends, if you're getting plain text from the server you can do it like this:[code]var txt = document.createTextNode(textOut)document.getElementById(div_handler.divTag).appendChild(txt)[/code]if you need to process more complex info, you could send an array from the server, actually a string seperated by a "|" or something, then use the [b]split[/b] function in js to create an array, then process the data.PS: innerHTML should work though, maybe you have a bug somewhere else..Hope it helps. Cheers. Quote Link to comment Share on other sites More sharing options...
fenway Posted January 10, 2007 Share Posted January 10, 2007 I thought it was innerText that didn't work in FF. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted January 14, 2007 Share Posted January 14, 2007 I believe the innerHTML was invented by ie and is old and definitely works on ie(I use it all the time). Things that are new like 'xmlDoc.getElementsByTagName' may not be supported by ie, however.--try this test with a static value on ie:[code]document.getElementById(div_handler.divTag).innerHTML = '**execution OK**';[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.