I think the entire problem here is the purely thought up structure.
With JS, you shouldn't be parsing HTML at all, you should be working
at DOM levelling, which means that you need to use
createElement/TextNode and appendChild rather than innerHTML.

Yes, that means that the PHP must ship the HTML in a way easily
parse-able for the JS, e.g. as some external XML or some generated JS
which already contains the entire "creation" of the HTML.  Besides, if
I recall correctly, PHP5 has a built in XMLparser, so you could easily
just write the HTML as you used to, and then parse it into XML
elements, and then make a shipper.

Alternative, and probably the method with the best result, don't apply
HTML tags at all with JS, just apply the content.  Why isn't the <div>
element already in the <td>?  Oh and, how is PHP going to change the
page at all now that it has been served?  Through AJAX?  But if you're
already going that way, why not try shipping the HTML code as XML
through AJAX instead?  Much easier parse-able.

Regards,
Svip

2008/5/30 Thierry Koblentz <[EMAIL PROTECTED]>:
>> >> And the node looks like this:
>> >>
>> >> <div id="newsnode">!!main_content!!</div>
>> >
>> > Try this:
>> >
>> > var maincontent=document.getElementById('newsnode');
>> > maincontent.firstChild.data="Hello World!";
>> >
>>
>> That is not changing the content of the div tag,
>> or anything on the screen.
>
> It should. What happens when you run the following in the Firebug console?
>
> $('newsnode').firstChild.data="Hello World!";
>
>
> --
> Regards,
> Thierry | http://www.TJKDesign.com
>
>
>
>
>
>
>
>
> *******************************************************************
> List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
> Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
> Help: [EMAIL PROTECTED]
> *******************************************************************
>
>


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to