super. I've put these up at

http://www.stolaf.edu/people/hansonr/jmol/applet/mscalc/jmolcalls.html

and

http://www.stolaf.edu/people/hansonr/jmol/docs/examples/jmolcalls.html

for people to compare.

timothy driscoll wrote:

I've posted a very simple test for accessing the JmolApplet.  it does away with 
almost all complexity that can cloud this issue.  you can see it here:

<http://dev.molvisions.com/debugging/jmolcalls.html>

it includes three methods:

1. getElementById
2. document.appletname
3. document.applets[]

so far, all three methods work for me in OSX: Safari 1.3, FF 1, Moz 1.7.3; also 
in IE6 (winXP).


a few oddities:

1. the messagecallback is somewhat inconsistent in its output.  that may have 
to do with the way I implemented it.  it does not seem to adversely affect the 
command stream, though.

2.  I developed this on my localhost server, and it worked without flaw.  then 
I copied it to my LAN www server and, without quitting my browser, tried it 
out.  it failed with all sorts of security exceptions.  I cleared my browser 
cache, quit and restarted, and now it works fine.


oddity 2 may point to the issue of accessing different Jmol pages, IOW different JmolApplets, and somehow confusing the browser or the JVM. but it does not point to a problem with actually sending scripts to the JmolApplet. we should spawn a new thread for discussing the cross-page problems, IMO.


one final note: method 2 above:

document.appletname

must account for the DOM of the page. IOW, if I put my applet inside a form named myform, for example, instead of directly under the body tag, my call would have to change to

document.myform.appletname


the other two methods do not require this change.



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

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


------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix _______________________________________________ Jmol-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to