Thanks Angel,

It turns out you need to make sure you have the serverURL parameter setup with 
a working jmol.php file which loads the external JavaScript files via PHP as a 
way to get round the security restrictions you mentioned.

Graeme

From: Angel Herráez [mailto:angel.herr...@uah.es]
Sent: 10 September 2016 11:44
To: jmol-users@lists.sourceforge.net
Cc: Kidd, Graeme <g.k...@hw.ac.uk>
Subject: Re: Load JSmol from external host

(moving this to the users list)

Hello, Graeme
In principle, yes, it is possible to load the JSmol libraries from a server 
different to the one that hosts the page.

However, the browsers may impose security restrictions for cross-browser access 
in certain circumstances (I don't know the precise details)

I believe you should be able to do this. Make sure that you load JSmol.min.js 
from the same server as the j2s folder, and try different browsers.

Example:
http://biomodel.uah.es/Jmol/audio.htm
works fine in Firefox and Chrome, at least

________________________________

On 10 Sep 2016 at 3:31, Kidd, Graeme wrote:


Would it be possible for JSmol to support the loading of the "j2s" and "java" 
folders from an external host? Currently when you put a full URL in the 
"j2sPath" or "jarPath" variables the following error appears:

"[Java2Script] The required class file 
http://externalhost.com/jsmol/j2s/core/package.js could not be loaded. Script 
error: Unexpected token < data: <!DOCTYPE html PUBLIC..."

Going to http://externalhost.com/jsmol/j2s/core/package.js does load the file 
without any problems.

Thanks,

Graeme

________________________________
Founded in 1821, Heriot-Watt is a leader in ideas and solutions. With campuses 
and students across the entire globe we span the world, delivering innovation 
and educational excellence in business, engineering, design and the physical, 
social and life sciences.

The contents of this e-mail (including any attachments) are confidential. If 
you are not the intended recipient of this e-mail, any disclosure, copying, 
distribution or use of its contents is strictly prohibited, and you should 
please notify the sender immediately and then delete it (including any 
attachments) from your system.
------------------------------------------------------------------------------
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to