Bob Hanson wrote: > Toby, does the following simple use of Jmol.js without any > document.write() violate XHTML protocol?
Yes > http://www.stolaf.edu/people/hansonr/jmol/docs/testlink.htm > > It seems to me > > <a href="javascript:void(document.getElementById('applet_A').innerHTML > =jmolApplet(300,'load examples/1crn.pdb','A'))">click here</a> > > is perfectly consistent with the DOM model and XHTML and XML. No? No. Sorry. Reiterating my last email (which probably crossed paths with this one) the problem is that within the DOM model, you can't just pipe an arbitrary string to the browser in the hope that it's valid XHTML, and that the browser can do something with it. The browser will generate a DOM tree when it first parses the page (assuming the page is valid XML) which you can then dicky with to your heart's content, so long as you do it through the DOM interface - the browser won't parse isolated fragments of XHTML. To put it another way, the browser parses valid XML documents - you're passing it a fragment of an XML document, which is meaningless without the context of a full document which might have namespace, DTDs, so on and so forth. How is the browser to know what "<applet>" means? What needs to happen is that jmolApplet generates a DOM node which is an XHTML object node; and then you can replace the above with <a href="javascript:void(document.getElementById('applet_A').appendChild(jmolApplet(300,'load examples/1crn.pdb','A')))">click here</a> -- Dr. Toby White Dept. of Earth Sciences, Downing Street, Cambridge CB2 3EQ. UK Email: <[EMAIL PROTECTED]> Tel: +44 1223 333464 Fax: +44 1223 333450 ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Jmol-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jmol-users

