[Javascript] Ajax + adding HTML

Flávio Gomes flavio at economisa.com.br
Tue Aug 8 14:13:36 CDT 2006


I believe it'd be something like

/ myText = createTextNode(Args)/

and then

/ getElementbyId("myId").appendChild(myText)/

Not so sure, never did it..

Bernu Bernard escreveu:

> 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
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript


-- 
Flavio Gomes
flavio at economisa.com.br




More information about the Javascript mailing list