Bob,

The file name does not contain the extension .bin, but if the URL was
being examined instead of the file name, then the string ".bin" does
appear (in .binghamton).

If I use the IP address for loncapa7.chem,binghamton.edu instead of the hostname, i.e., http://128.226.130.234/res/msu/raeburn/testing/jmol/jsmolwebpage.html

then Safari will display the molecule in jsmol without error.

That supports my idea that the string: .bin within chem.binghamton.edu is causing jsmol to consider that the "load caffeine.mol" call in jmolApplet() is a request for a binary file.

Stuart Raeburn
LON-CAPA Academic Consortium


Quoting Stuart Raeburn <raeb...@msu.edu>:

Bob,

I've coded up my first problem with Jsmol and it works fine on the latest
Chrome and Firefox.  But it doesn't work on Internet Explorer 11 or Safari
(latest).

This issue appears to be specific to the binghamton servers. I am able
to display an example web page of mine (published public) which uses
jmol/jsmol:

/res/msu/raeburn/testing/jmol/jsmolwebpage.html

successfully in Safari on a number of LON-CAPA servers in the network,
apart from the ones in your domain. (I am also able to display that
resource from servers in your domain if I use Firefox or Chrome).

When I attempt to use Safari to display that page on:
loncapaN.chem.binghamton.edu (N = 2, 3, 5, 6, or 7) two errors are displayed:

(a) A dialog box with the message: "JSmolCore.js: synchronous binary
file transfer is requested but not available"
and then (if I click "OK") some seconds later:

(b) A dialog box with the message:

Error connecting to server:
http://your.server.here/jsmol.php?call=getRawDataFromDatabase&database=_&query=http%3A%2F%2Floncapa7.chem.binghamton.edu%2Fres%2Fmsu%2Fraeburn%2Ftesting%2Fjmol%2Fcaffeine.mol&encoding=base64

Looking at the jsmol documentation:
http://wiki.jmol.org/index.php/Jmol_JavaScript_Object

(see: "Reading binary files" section)

I find that jsmol.php will be called if a binary format file (gz, zip,
pse, etc.) is requested from Safari, Chrome, or MSIE, and a jsmol.php
file needs to be used to convert the binary data to BASE64 format. The
documentation states jsmol.php is a "A server-side PHP utility that
allows a number of functions that can increase the platform and browser
compatibility of JSmol".

By default http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php will be used.
However, if you modify /home/httpd/html/jmol/Jmol.js by modifying this line:

serverURL: "http://your.server.here/jsmol.php";, // required for binary
file loading (.bin .gz .zip .jpg .png .jmol .smol .spartan .mrc or .pse
files).

and replace http://your.server.here/jsmol.php with the hostname of your
server (and an appropriate path) you could use a local jsmol.php file,
and thereby override the default behavior of jmolInitialize().

You would need to obtain jsmol.php from the jmol binary (from
http://sourceforge.net/projects/jmol/files/Jmol/Version%2014.2/Version%2014.2.13/Jmol-14.2.13_2015.03.23-binary.zip/download ) because the jmol-loncapa.zip file included in the LON-CAPA 2.11.1 tarball does not include
it.

What is odd about this is that the caffeine.mol file (MIME:
chemical/x-mdl-molfile) is not a binary file, and I am able to download
this text file directly via:
http://loncapa7.chem.binghamton.edu/res/msu/raeburn/testing/jmol/caffeine.mol

The documentation does say:

'These "extensions" can appear anywhere in a file name to trigger the
binary access mode. So, for example, if you rename any file to include
.bin anywhere in its name, that will instruct JSmol to read it as a
binary file'.

The file name does not contain the extension .bin, but if the URL was
being examined instead of the file name, then the string ".bin" does
appear (in .binghamton).


Stuart Raeburn
LON-CAPA Academic Consortium

Quoting Bob Gonzales <rgon...@binghamton.edu>:

Hi,

I've coded up my first problem with Jsmol and it works fine on the latest
Chrome and Firefox.  But it doesn't work on Internet Explorer 11 or Safari
(latest).  The both complain about the file format.  IE says 'unrecognized
file format for file xxx' and Safari says it doesn't know how to open the
binary file.

I'm using .mol files.

I'm invoking the viewer with the following code:

<script src="/adm/jmol/Jmol.js" type="text/javascript"></script>
<script type="text/javascript">jmolInitialize("/adm/jmol");</script>
<script type="text/javascript">jmolApplet(150,"background [xFFFFCC]; load
../Graphics/type04/$correctMolecularGeometry.mol");</script>

It would be great to get this to work on IE since that is what is available
on our instructional computers.

Thanks,
Bob Gonzales

_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users



Stuart Raeburn, Ph.D.          LON-CAPA (cell) +1 517 881-3308
Dept. Physics & Astronomy      Other (cell) +1 734 277-2795
Michigan State University      raeb...@msu.edu
MI 48824 USA

_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users

Reply via email to