Apr 28, 2006
Ok so, this is my purpose:
View 3 Replies
For example, let's say I call a php file via ajax, and it returns the output into a variable named "text" containing "document.write('hello')"
if I use xxx.innerHTML=text, nothing happens
My 1st solution:
if I eval the code, it deletes my current page and renders a new one
for example, if I parse a document.write, my page disappears, and a new one is rendered with the document.write text
What I want is basically to make that "document.write" appear inside a div in my page, adding to the content (and not overwriting the whole page), much like what happens when using innerHTML
Is this even possible? How would you go about it?
I tried xxx.innerHTML=eval(outputfromphpfile) but it overwrites my whole page...