I'm hoping to implement some changes in the way the applet.script() JavaScript command works.

New option for running scripts "synchronously":

var status = applet.scriptWait("select carbon;....")

Here the script runs "synchronously" meaning the JavaScript waits at this point until script termination. The JavaScript "status" variable is then filled with status information so that one could evaluate what worked or didn't with the script. Compilation errors, messages, measurments, "show" results, etc., would all be returned and could be processed. OK, so no one should have a problem with that, I think.

And here's another:

var strError = applet.scriptCheck("select carbon;....")

This one just runs the initial compiling, but doesn't actually run the script. So here we would return the error message if it resulted.

Now, here's the question. Do you want/not want:

var strError = applet.script("select carbon;....")

That is, have the script command return an error message if there is one during compiling? The reason I ask is that this does seem to me useful, but the problem might be if people have links that look like this:

<a href="javascript:document.getElementById('jmolApplet0').script('select carbon')">select carbon</a>

Because this will return a string now, which is different from returning "nothing." In the <a> context, a javascript string return will pop up a new window with the message in it. Instead, these would have to be changed to:

<a href="javascript:void(document.getElementById('jmolApplet0').script('select carbon'))">select carbon</a>

I guess I could implement:

var strError = applet.scriptReturnError("select carbon;....")

and leave

applet.script("select carbon;....")

alone?

Bob Hanson

--

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

"Imagination is more important than knowledge."  - Albert Einstein



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to