On second thought, it's annoying to have to use getElementById -- I just
changed that to the id instead:

    jmolSetXHTML("applocation")


just seems more reasonable to me.

Bob


On Thu, May 7, 2009 at 10:25 AM, Robert Hanson <hans...@stolaf.edu> wrote:

> I don't have IE8, but I did try this in Opera. The Jmol.js code I had there
> was not working, because Opera allows document.write (or at least throws no
> error) even with XHTML mode. So I added to Jmol.js the following method:
>
>  jmolSetXHTML(element)
>
> I think this is important so that the developer is explicit about wanting
> XHTML mode or not.
> "element" is optional and if present is the document element (not just it's
> id) into which the code will be placed.
> Note that this allows some nice functionality for all of us, because this
> method should work on any page, not just XHTML, and allows for writing jmol
> parts to various places in the document:
>
>  // insert at the current script location, as usual:
>
>     jmolSetXHTML()
>     jmolInitialize(".")
>     jmolApplet(400, "load data/1crn.pdb")
>     jmolBr()
>     jmolHtml("testing")
>     jmolCheckbox("background blue","background black","test")
>     jmolButton("background red","background red")
>
>
>  // insert into a specific div:
>
>     jmolSetXHTML(document.getElementById("applocation"))
>     jmolApplet(400, "load data/1crn.pdb;spin on")
>     jmolBr()
>     jmolHtml("testing2")
>     jmolCheckbox("background blue","background black","test2")
>     jmolButton("background red","background red")
>
> In addition, this is kind of neat because you can use it anywhere, anytime,
> even after the page is loaded.
>
> http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol.js
> http://chemapps.stolaf.edu/jmol/docs/examples-11/jmolsvg.xhtml
>
>
> Bob
>
> 2009/5/7 Angel Herráez <angel.herr...@uah.es>
>
>> Good catch, Jonathan!
>>
>> Now it is working in all browsers including IE8
>>
>>
>>
>> ------------------------------------------------------------------------------
>> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>> production scanning environment may not be a perfect world - but thanks to
>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK
>> i700
>> Series Scanner you'll get full speed at 300 dpi even with all image
>> processing features enabled. http://p.sf.net/sfu/kodak-com
>> _______________________________________________
>> Jmol-users mailing list
>> Jmol-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>
>
>
> --
> Robert M. Hanson
> Professor of Chemistry
> St. Olaf College
> 1520 St. Olaf Ave.
> Northfield, MN 55057
> http://www.stolaf.edu/people/hansonr
> phone: 507-786-3107
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to