sazzie Posted January 5, 2007 Share Posted January 5, 2007 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. ;) Link to comment https://forums.phpfreaks.com/topic/32949-solved-encoding-javascript-text-object-to-html/ Share on other sites More sharing options...
fenway Posted January 6, 2007 Share Posted January 6, 2007 "Pours out"? Link to comment https://forums.phpfreaks.com/topic/32949-solved-encoding-javascript-text-object-to-html/#findComment-154513 Share on other sites More sharing options...
irken Posted January 7, 2007 Share Posted January 7, 2007 Hehe, I think he means like, the pre tag. Showing the HTML code rather than evaluating it.Hmm.. can you post some code of what you got? Link to comment https://forums.phpfreaks.com/topic/32949-solved-encoding-javascript-text-object-to-html/#findComment-154636 Share on other sites More sharing options...
fenway Posted January 7, 2007 Share Posted January 7, 2007 Well, you asked for a text node, so you're getting raw text. Link to comment https://forums.phpfreaks.com/topic/32949-solved-encoding-javascript-text-object-to-html/#findComment-155013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.