From: Bob H. <ha...@st...> - 2005-09-28 14:36:16
|
An interesting question! Right, now that you can have a page local and still access anything online, the question becomes -- how do you know if you are local! I pulled the plug on my machine to see what would happen with these script node calls. The answer is: nothing. No error, no response is returned. If you wanted to test for this and adjust AFTER the fact -- after the student requests a model -- you could: 1) set the variable A=new Array() 2) set a timer to check "if(A)" after some reasonable amount of time. If it isn't there, you could pop up a message such as "Server may be offline" or something like that. This is because the server loads array A when it returns. ALternatively, if you want to check to see if a machine is totally offline right when the page loads, the following might work: a) write a little file checkonline.js that contains only: online=true b) place it on your website at http://somewhere/checkonlin.js c) add the following script to your web page: <script type="text/javascript"> isonline=false s='<'+'script type="text/javascript"' +' src="http://somewhere/checkonline.js?' +Math.random()+'"></'+'script>' document.write(s) </script> <script type="text/javascript"> if(!isonline).... </script> The idea here is to load a script that changes a variable to be TRUE. If the script doesn't load, because you are offline, then you find that out, because the variable never gets set. The nonsense there with the script writing another script is to ensure that no caching occurs. You might think the following will work: <script type="text/javascript"> isonline=false </script> <script type="text/javascript" src="http://somewhere/checkonline.js"> </script> <script type="text/javascript"> if(!isonline).... </script> But I think then checkonline.js will get cached, and you won't necessarily know if the machine is offline. Bob > > ------------ > > Third issue: several have complained about various things on the Mac > not working. I'm using release 10.00.39 on a Mac w/ OS 10.4.2 (all the > updates as of today), and both Safari 2.0.1 and FireFox 1.0.7. Both > work just fine with everything. I'll guess that the most recent Mozilla > also works fine, but I don't test it often. Does this include the pop-up example windows (from the selection box) in the documentation? http://www.stolaf.edu/people/hansonr/jmol/docs or, if not, http://www.stolaf.edu/people/hansonr/jmol/docs?useobject ? > > Craig > > Craig Martin > cm...@ch... > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Jmol-users mailing list > Jmo...@li... > https://lists.sourceforge.net/lists/listinfo/jmol-users -- Robert M. Hanson, ha...@st..., 507-646-3107 Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057 mailto:ha...@st... http://www.stolaf.edu/people/hansonr "Imagination is more important than knowledge." - Albert Einstein |