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.

So in the headers of the pages that call JSmol I have this. 

        <script type="text/javascript">
                var Info = {
                        j2sPath: "../../reuse/j2s",
                        use: "HTML5",
                        serverURL: "../../reuse/php/jsmol.php"
                };
                Jmol._alertNoBinary = false;
        </script>

The Jmol._alertNoBinary= false; was suggested to suppress and error message 
that Safari keeps giving when it goes to download the file. The error still 
shows up in Safari’s “Error Console” but it has no effect that I can see on the 
loading of the page. 

I haven’t finished switching everything over, but so far it has been working.

Chris


On Jan 16, 2014, at 8:47 AM, Marcey, David <mar...@callutheran.edu> wrote:

> I am having trouble getting Jsmol to load gzipped files as well. Can someone 
> point me to the exact place to enter my server address in Jmol2.js? I’ve done 
> this for the two places where a search for “php” turned up.
> 
> Unzipped files are loading fine.
> 
> Thanks,
> David

[…]

> On Jan 10, 2014, at 10:28 AM, Angel Herráez <angel.herr...@uah.es> wrote:
> 
>> Hello, Chris
>> 
>> A few things to check:
>> 
>> 1- Have you pointed to the jmol.php file in your own server?  
> 
> No, I hadn’t. 
> 
> Now my header looks like this
> 
> <script type="text/javascript" src="../../reuse/JSmol.min.js"></script>
> <script type="text/javascript" src="../../reuse/Jmol.js"></script> 
> <!--location of renamed Jmol2.js library-->
> <script type="text/javascript">
> var Info = {
> j2sPath: "../../reuse/j2s”, //location of j2s directory on my server
> use: "HTML5",
> serverURL: "../../reuse/php/jsmol.php” //location of jsmol.php on my server
> };
> </script>
> 
> 
>> That is 
>> specified in definition of the "Info" variable of J(S)mol, either in 
>> your own page or in the Jmol2.js file. As far as I know, loading of 
>> binary files relies of that php file and it must be in the same 
>> server for full operation. The default Info points to StOlaf server, 
>> so you need to set it properly.
> 
> It took me a little while to find how to set that setting in the “Info” 
> variable, but eventually I found it in one of the sample files and on the 
> JSmol wiki here
> 
> http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#JSmol

[…]

> Thanks for the help!
> 
> Chris
>   […]
> ------------------------------------------------------------------------------
> 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

--
Learn about Brittle Bone Disease
http://www.oif.org
--
Christopher J. Masi, Ph.D.
Associate Professor of Chemistry
Westfield State University
577 Western Ave
Westfield, Massachusetts 01086
(413)572-5371

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