Jeff Hansen wrote:

> Ok.  I'm kinda confused now.  I started this when I saw the following.
> So were those commands issued from the console?  Is it not possible to 
> include them in a button?  Incidentally, I'm using the signed applet 
> and Jmol 11.1.39.  And it works fine from the console, just not from a 
> button.  Trying Bob's page at 
>
> http://www.stolaf.edu/academics/chemapps/jmol/temp/signed/test.htm
>
> I can of course load file using the load a PDB file link although 
> technically that doesn't load a file it rewrites the page and loads 
> the file.  However, typing load "=1crn" into the text box and clicking 
> execute gives the java security error.
>
> If it isn't possible that is fine.  Just seemed like it would be nice 
> to do it this way so I thought I would give it a try.  I guess it 
> won't work.
>
>

You are in good company, Jeff, reading all the bug reports about this. 
It's not a bug, it's an important security feature. What they have done 
is isolated JavaScript from the signed capabilities of an applet. No 
JavaScript on a page can direct an applet to do anything that it can do 
ONLY because it is signed. Strangely enough, though, if the JavaScript 
creates a whole new applet, with the load command part of the 
construction process, as I do on that page with the prompt, then, (what 
do you know?) the new applet can operate in a signed mode, as directed 
by the JavaScript.

To say again:

1) JavaScript cannot script an applet to do any signing-required process.
2) JavaScript can create applet instances on the fly, and if in doing so 
the (new) applet is directed to do something that requires signing, it's 
not a problem.

This certainly makes no sense to me. But it does provide an option that 
allows loading of files from any site into Jmol. Instead of

jmolScript('load "=blu"')

you need

create-a-new-applet-and-run-the-script('load "=1blu"')

That's what my code does on that page. First, I create a div containing 
the applet. Then, to load a new file, I create code for a whole new 
applet using jmolSetDocument(0), and place it in that div. The new 
applet "appears" instantly, loads the file, and the effect is that the 
user sees just what you might expect them to -- a new model loaded. 
Quite a hack, really.

Bob



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