On 2005-04-20 (20:03) Bob Hanson wrote:

>Thanks, Tim. OK, the setTimeout() issue is a hard one to track down.
>I think I should have qualified this as involving links when there
>is a defined messageCallback function. That was the situation -- not
>just regular links. I'm the one who notices it because I'm one of
>few people employing messagecallback functions. It's specifically
>with that complication that issues arise, I think.
>
hi Bob,

I use msgcallbacks as well, and no setTimeouts.  can I assume you mean to 
emphasize the Opera browser?  I don't use or test with that one, so I can't 
comment.  but these two pages work the same for me in other browsers:

>Here are two examples for comparison:
>
>http://www.stolaf.edu/people/hansonr/jmol/applet/mscalc/view.htm
>http://www.stolaf.edu/people/hansonr/jmol/applet/mscalc/
>view_NOSETTIMEOUT.htm
>
>I promise to leave these alone now so that they aren't moving
>targets! In my experimentation, the second crashes Opera 7.52. The
>only difference is that the scripts in view.htm are sent out using
>

I don't meant to belabor the point, but recommending widespread use of 
setTimeouts leads to headaches IMO, so I think it is important to be specific 
about when they are necessary.

regards,

tim
-- 
Timothy Driscoll
molvisions - see, grasp, learn.
<http://www.molvisions.com/>
usa:north carolina:raleigh




>
>timothy driscoll wrote:
>
>>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
>


-------------------------------------------------------
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

Reply via email to