On 2005-04-20 (12:12) Bob Hanson wrote:
>Thanks to all for feedback on the test pages:
>
>http://www.stolaf.edu/people/hansonr/jmol/applet/mscalc/view.htm
>
<snip>
hi Bob,
thought I'd add my $0.02 on one of your lessons learned:
>
>5. Another issue involves setTimeout() and scripting an applet. If
>you are going to script the applet using a link, that is: <a
>href=javascript:....>, or if you want to support Opera at all, it is
>imperative that you use setTimeout() to trigger the event. This
>means that using
>
><a href="javascript:document.jmol.script('xxxx')">
>
>is a sure-fire way to have user problems. I recommend
>
><a href="javascript:doscript('whatever')">
>
>and then creating a function that starts a new thread using
>
>setTimeout("applet.script('"+whatever+"',100)
>
>I'm pretty sure jmol.js does NOT do this yet, so jmolLink() may not
>work on all platforms, and ANY scripting/callbacks may not work some
>Opera browsers. I can confirm that this is a problem even with
>messageCallbacks (not just links) under Opera 7.52.
>
I'd be interested to see a test case for this. I have never had a problem
calling jmol.script() directly from an anchor as you describe, and I do it an
awful lot. I do not test in Opera, so it may very well be a problem there, but
I do test in FF, Moz, NS, Safari (Mac), and IE (Win). do you have a simple
example page that I can view?
I do use setTimeout, in case I'mm caught trying to send a script to Jmol when
it is either not loaded or busy. it simply loops until Jmol is ready, then
sends the queued commands. this works great.
one lesson I would add is this:
I have found it very helpful to escape Jmol command strings as they pass thru
javascript functions, then unescape them right before they pass to Jmol. this
has helped me solve lots of nagging problems.
regards,
tim
--
Timothy Driscoll
molvisions - see, grasp, learn.
<http://www.molvisions.com/>
usa:north carolina:raleigh
"The more I study science, the more I believe in God." - Albert Einstein
-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users