I'm ALMOST certain I started worrying about this when I was having Mac/Safari
problems at http://www.stolaf.edu/people/hansonr/jmol/docs/examples/moveto.htm

Currently I can't click a link on that page in Safari, so I don't know what is
going on there. But I think it started as an observation while testing 
Mac/Safari.

I'm glad to hear there isn't any serious Mac issue with my latest. But those
with Macs, if you are still interested in ruining my week can check the above
link as well.

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

I agree completely. Although with your escape idea, it's not such a huge hassle. Just instead of


function jmolScript(script, targetSuffix) { if (script) { _jmolCheckBrowser(); var target = "jmolApplet" + (targetSuffix ? targetSuffix : "0"); var applet = _jmolFindApplet(target); if (applet) return applet.script(script); else alert("could not find applet " + target); } }

now just a couple of added lines does the trick:

function jmolScript(script, targetSuffix, isnow) {
  if (script) {
    _jmolCheckBrowser();

/////
if(isnow)script=unescape(script);
else return setTimeout("jmolScript('" +escape(script)+"','"+targetSuffix+"',1)",10))
/////


    var target = "jmolApplet" + (targetSuffix ? targetSuffix : "0");
    var applet = _jmolFindApplet(target);
    if (applet)
      return applet.script(script);
    else
      alert("could not find applet " + target);
  }
}

That doesn't seem like such a big deal to me.
I think that jmol.js could painlessly do this.
jmol.script() is asynchronous anyway, so setting
it in its own thread seems like fine sense to me.

But on the other hand, jmol.js doesn't support pickcallback and messagecallback anyway, does it? I guess you can sort of finesse it with:

jmolApplet(400,"'/><param name='messagecallback' value='myfunc")

But that's kind of a kludge. I don't think Miguel would like that call!


Bob




If you don't want to support Opera, it doesn't look like a problem, and as I said, after thinking about it, it must have something to do with the scripting calls in combination with callbacks in some subtle way, as that is the ONLY difference between those two pages, and one definitely crashes Opera. But call it an Opera problem for now. I just upgraded to Opera 8.0; same crash at


http://www.stolaf.edu/people/hansonr/jmol/applet/mscalc/view_NOSETTIMEOUT.htm

but not at

http://www.stolaf.edu/people/hansonr/jmol/applet/mscalc/view.htm

go figure.

Oh, and Opera 8.0 fixes the parseFloat(""). Now it is NaN there as well.


Bob


timothy driscoll wrote:

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



regards,

tim

-- Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:[EMAIL PROTECTED] http://www.stolaf.edu/people/hansonr




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