Interesting observation, Angel! This is the correct behavior.
This has to do with the LOAD ASYNC option, which is still experimental.
When loading resources asynchronously, JSmol may have to get part way into
a command, discover a need for a class or data file that has not been
loaded, and load that class asynchronously. In order to to that, it has to
"kill" its current script thread, because there's no "wait for something to
happen" option in JavaScript.
The way I am handling this in JSmol is to save the "script context stack"
that shows exactly where the program is in however many levels of scripting
have been executed -- same as when you use the THROW command. When the
resource is loaded, JSmol restarts the script stack exactly where it left
off.
In the case of LOAD ASYNC we have:
1. LOAD ASYNC "xxxx.mol" processed, but file data not present, so it can't
complete
2. script context saved;
3. script queue paused;
4. asynchronous call made to load that file
5. asynchronous callback returns with file data and a pointer to the script
context
6. file data for "xxxx.mol" saved in a cache
7. script queue restarted
8. script context restarted
9. LOAD ASYNC "xxxx.mol" processed a second time, now with file data present
10. xxxx.mol data now loaded from the cache
11. script processing continues as usual
You can also see in the developer console that an asynchronous call was
made:
xhr.open async=false url=j2s/J/shape/Frank.js jquery.js:9647:6
xhr.open *async=true* url=data/caffeine.mol jquery.js:9647:6
xhr.open async=false url=j2s/J/render/BallsRenderer.js jquery.js:9647:6
Cool, huh?
Bob
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users