Olaf Bosch schrieb:
> Hi all, a jquery ;)
>
> i wanted to at LI append to existing UL
> so:
> $("#menu").append("<li><a href=.......</li>");
>
> Works fine in IE and Local in all others.
>
> This Site works online with Content Negotiation, will say FF or Opera
> and so ones become application/xml
>
> Now, is works not, not valid!!!
>
> See in inspector is a DIV involved??? <div ........><li><a href=........
> i have say LI not DIV!?
>
> What is to do?
>
In XHTML as XML you cannot rely on innerHTML (appending HTML strings),
that is not supported by all browsers and is absolutley no standard
anyway...
Try this (first create the li element and then get the DOM node to append):
$("#menu").append( $("<li><a href=.......</li>")[0] );
This may cause the same problem as before, if so you have to resort to
basic DOM scripting:
$("#menu").append( document.createElement('li') );
-- Klaus
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/