Hola, Mauricio 

I've had this sort of trouble and I am pretty sure of the cause:

The applet takes some time to load, and the scripts run ahead of it. That's why 
if you put the 
"load" in jmolApplet() the molecule gets loaded, but the script is not. 
Probbaly if you reload 
the page, the script will work.

If you check the Javascript console for your browser, you will probbaly see 
"jmolApplet0 not 
found" or something of the sort.

The solution is 
a) put all the script inside jmolApplet()
or
b) have by some way the script being invoked by user action, not run as the 
page loads.

I'm not sure if using jmolScriptWait() will help here.

So, try
<script type="text/javascript">
jmolInitialize("../jmol-11.0.1/");
jmolSetAppletColor("white");
jmolApplet(512, "load vdb/1stm.pdb;cpk off;wireframe off;cartoon on;color 
structure;",0);
</script>


> Can I call jmolScript anywhere I want in the page (inside html script tags or 
> inside another js file 
> <script src="./file.js" type="text/javascript"></script>) after the applet 
> starts?

In principle it can go anywhere, but the key is "after the applet satrts", and 
you never know 
how long it will take to start. Tricky.



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to