[font=trebuchet ms]Hi guys,
I have a PHP-JavaScript communicating script that I’m using to update a page automatically every two seconds. I’d like to avoid as much processing as possible, obviously, so that the application runs more quickly. However, I’ve run into a slight problem. I’m processing URL’s (and some UBB code) on the server (in PHP) and using JavaScript to retrieve the content. I am using the DOM to create a paragraph and new text node to update the page, but when HTML is processed and output by PHP, JavaScript turns up with “undefined.” I know this is because HTML isn’t allowed when creating a text node, but I don’t know how to output the text, the HTML, and any remaining text that PHP might output without having to process the HTML/text altogether as a string in JavaScript. I want to avoid extra processing and I’m trying my best not to use the “innerHTML” attribute. Is there any efficient way to take a string with text and HTML mixed in it and output it as an HTML paragraph with the createTextNode method? (And, of course, without using the “innerHTML” property.)
Thanks,[/font]