Good sleuthing. I have added serverURL to the default Info block in
Jmol2.js and added a comment about it there.

If you can avoid making any changes to JSmol.min.js, that's wise. A real
headache to maintain if you do.

I don't recommend making this entry relative unless you are absolutely
certain that all your files are all in the same relative position. It also
will only work for creating PNG or PNGJ files if you have it on a server;
PHP files won't be processed locally.
As long as you local-test with FireFox, JSmol won't be calling that php
file for file loading, only for file creation.

Bob


On Thu, Jan 16, 2014 at 12:13 PM, Christopher Masi
<cm...@westfield.ma.edu>wrote:

> David,
>
> Found it…
>
> Warning: I have no idea what I’m doing, and I could be breaking
> everything. By trial and error I discovered the following:
>
> I couldn’t get gz file download to work by putting anything in the
> jmol2.js file. I thought the “serverURL" belonged between lines 38 and 37,
> but that didn’t work.
>
> It occurred to me that the JSmol.min.js file was being called by my page,
> so I decided to search the JSmol.min.js file. I found multiple occurrences
> for the “serverURL” value. On line 269 I replaced the “
> http://your.server.here/jsmol.php” with a path to my php file and it
> worked. It worked when I used the complete URL, and it worked when I used a
> relative path. However, it has occurred to me that the relative path will
> not always be the same. The relative path that seems to matter here is not
> the path from where the JSmol.min.js file resides to the Jmol.php file but
> the relative path from where that file is being called from (the location
> of the html file) to the Jmol.php file.
>
> Since I test my pages on my personal computer before uploading them to a
> server, I don’t want to hard code a URL (
> http://blah.blah.blah/php/jmol.php) into this file. Since I may not
> always call JSmol from the directories that are always at the same depth in
> my web pages, I think that I am going to keep putting the “serverURL:”
> value in the header of the page that calls for JSmol. That way I can use
> relative paths and I can get the pages to load regardless of the server
> that is hosting them.
> -
>
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to