Jeff, now if you are going to use that "Jmol2.js" then you need to add

 jmolSetXHTML()

just before the applet call.

Bob


On Wed, May 6, 2009 at 11:17 PM, Jeff Hansen <[email protected]> wrote:

> Bob,
> You beat me to it and of course your solution is more sophisticated than
> mine.  For the record here is what I did.
>
> function _jmolDocumentWrite(text) {
>   if (_jmol.currentDocument)
>     var newcontent = document.createElement('div');
>     newcontent.appendChild(document.createTextNode(text));
> var str = '';
> for (var i = 0; i < text.length; i++)
>       str += String(text[i]);
>     document.body.innerHTML=str;
> //    _jmol.currentDocument.write(text);
>   return text;
> }
>
>
> You can see it in action here:
>
> http://webme.com/jhansen4/iWeb/Jmol/JmolPlusSVG.xhtml<http://web.me.com/jhansen4/iWeb/Jmol/JmolPlusSVG.xhtml>
>
> I'll grab a copy of your revised Jmol.js and begin using that.
>
>
> Thanks!
>
>
> Jeff
>
> ***********************************************
> Jeff Hansen
> Department of Chemistry and Biochemistry
> DePauw University
> 602 S. College Ave.
> Greencastle, IN 46135
> [email protected]
> ***********************************************
>
>
> On May 7, 2009, at 12:01 AM, Robert Hanson wrote:
>
> Well, you are quicker than I am. Try this:
>
> http://chemapps.stolaf.edu/jmol/docs/examples-11/t2.xhtml
>
> and
>
> http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol.js
>
>
> On Wed, May 6, 2009 at 8:35 PM, Jeff Hansen <[email protected]> wrote:
>
>> Bob,
>> The idea is to use a multiple model file in Jmol, pull out the energies of
>> each model, and use that data to generate an svg graph.  The svg should
>> highlight the point corresponding to the model currently being displayed and
>> likewise if the user clicks a point on the svg it will highlight the point
>> and update the jmol to display the corresponding model.  In other words, the
>> svg will be a graph of the energies of the models and the svg and applet
>> will "talk" to each other.
>>
>> Currently I am using jmolInitialize, jmolApplet, jmolEval, and
>> jmolGetPropertyAsArray.  Of course I would prefer to use jmol.js but if
>> necessary can do without it.
>>
>>
>> Jeff
>>
>>  ***********************************************
>> Jeff Hansen
>> Department of Chemistry and Biochemistry
>> DePauw University
>> 602 S. College Ave.
>> Greencastle, IN 46135
>> [email protected]
>> ***********************************************
>>
>>
>> On May 6, 2009, at 7:52 PM, Robert Hanson wrote:
>>
>> Ah, that sounds familiar. Correct. There is no "document.write" in XHTML.
>> Sorry. That pretty much rules it out.
>>
>> As I recall Egon at one point wrote a DOM-specific XHTML version of a page
>> that worked with Jmol, though not Jmol.js.
>>
>> But you don't necessarily have to have Jmol.js to use Jmol. You just have
>> to work harder to do it without.
>>
>> So what is the deal with "inline SVG"?
>>
>> Bob
>>
>>
>> 2009/5/6 Angel Herráez <[email protected]>
>>
>>> It seems that the first hit is caused by document.write not being
>>> supported
>>> by XHTML (documented in several websites)
>>>
>>> My test:
>>> XHTML 1.0 Transitional
>>>
>>> _jmol.currentDocument.write(text);
>>> at line line 834 within
>>> function _jmolDocumentWrite(text) {
>>>
>>> throws an error in Firefox 3
>>> No error in Opera, but no applet
>>>
>>> Clue:
>>> Does document.write work in XHTML?
>>> No. Because of the way XML is defined, it is not possible to do tricks
>>> like
>>> this, where markup is generated by scripting while the parser is still
>>> parsing
>>> the markup.
>>> You can still achieve the same effects, but you have to do it by using
>>> the
>>> DOM to add and delete elements.
>>> (source: http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite)
>>>
>>>
>>> And quoting
>>> http://jmol.sourceforge.net/docs/JmolAppletGuide.html#XHTMLSupport
>>>
>>> the standard Jmol.js Javascript library will not work under properly
>>> compliant XML browsers. An alternative, largely similar, but entirely
>>> unsupported library is available ... insert address here ...
>>> (that JmolAppletGuide doc is old --Miguel's times? . but true indeed)
>>>
>>>
>>> I've tested the alternative to document.write given at
>>> http://weston.ruter.net/projects/xhtml-document-write/
>>> http://shepherd-interactive.googlecode.com/svn/trunk/xhtml-document-
>>> write/xhtml-document-write.js<http://shepherd-interactive.googlecode.com/svn/trunk/xhtml-document-%0Awrite/xhtml-document-write.js>
>>>
>>> and, althogh it does not solve the problem, is on its way:
>>>
>>> Opera displays a functional applet, but below it is the  yellow box that
>>> says
>>> "you don't have Java" (generated by Jmol.js)
>>>
>>> Firefox displays a Java box with an error, applet class not found, and
>>> the
>>> yellow box below it
>>>
>>> IE8 displays nothing --seems not to like xhtml at all --even with no Jmol
>>> code in the page, it just displays a blank page and does a download --of
>>> the
>>> page?.
>>>
>>>
>>> More to come...
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> 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
>>> [email protected]
>>> 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
>>
>> ------------------------------------------------------------------------------
>> 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
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>> [email protected]
>> 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
>
> ------------------------------------------------------------------------------
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
>
> ------------------------------------------------------------------------------
> 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
> [email protected]
> 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
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to