[Javascript] Ajax + adding HTML

Bernu Bernard bernu at lptmc.jussieu.fr
Tue Aug 8 13:18:19 CDT 2006


Hi,
When using Ajax method, I send from the server some HTML code as a  
string :  essentially combination of <div> and <p>.
On the client side, when receiving this string, I use

document.getElementById("myId").innerHTML=receveived_code;

Now, it seems that this is a bad habitude as innerHTML is not in the  
DOM.
in  http://www.quirksmode.org/dom/w3c_core.html , I did not find how  
to do this.

What is the good way of doing transforming a string in the  
corresponding HTML code ?

Any reference or suggestion will be appreciated.

Bernard



More information about the Javascript mailing list