Jump to content

[SOLVED] Encoding Javascript text object to html


sazzie

Recommended Posts

I have a project I'm working on - an ajax project.

In my javascript call back function I have the following line :

[color=green]var newTextElement = document.createTextNode(text);
document.getElementById("div2").appendChild(newTextElement);
[/color]

'text' actually contains html code so I want a webpage displayed but it just pours out my code.

Can anyone advice me on how to get the text to be recognised as html code and display my webpage.  ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.