hhello,
how can i accomplish this:
I am using ajax communicating with my server with the output code i wish to \ use it to create an element div or even just text and stick it into a parent element as 'data' but i want the data to be as text/html from its output. the only node i can find for appending anything text to an element is createTextNode, but this strips out html which i cant seem to find a work around, how can i create a new element dynamically with html/text data? would this just mean i wouykd have to process every html element from the raw text node??
var txt = document.createTextNode(a);
document.getElementById('parentdiv').appendChild(txt);
var p=document.createElement("HR");
document.getElementById('parentdiv').appendChild(p);
edit: sorry nvm i fixed my problem, i forgot that i could just create a child div with the innerhtml then append it to the element, was too tired to realize this....
as a side question, ehh what should i mainly lookout for using ajax client to server 'security' suggestions?
how can i accomplish this:
I am using ajax communicating with my server with the output code i wish to \ use it to create an element div or even just text and stick it into a parent element as 'data' but i want the data to be as text/html from its output. the only node i can find for appending anything text to an element is createTextNode, but this strips out html which i cant seem to find a work around, how can i create a new element dynamically with html/text data? would this just mean i wouykd have to process every html element from the raw text node??
var txt = document.createTextNode(a);
document.getElementById('parentdiv').appendChild(txt);
var p=document.createElement("HR");
document.getElementById('parentdiv').appendChild(p);
edit: sorry nvm i fixed my problem, i forgot that i could just create a child div with the innerhtml then append it to the element, was too tired to realize this....
as a side question, ehh what should i mainly lookout for using ajax client to server 'security' suggestions?