##Using SimpleHTTPServer to run JSmol locally with Chrome
adapted from Nelson Liu's post to Jmol Users' list Tue, 17 Feb 2015. It will work out of the box on both Mac and Linux machines. Windows will need Python installed and a terminal emulator (UNTESTED!!). Doesn't matter if you are already running Chrome; I didn't have luck with
open -a /Applications/Google\ Chrome.app/ --args --allow-file-access-from-fileswhen I already had Chrome running.
-
Skip the first three steps if you already downloaded Jmol, unpacked it, and unpacked
jsmol.zip. -
Download Jmol binary.
-
Unpack binary.
-
Unpack
jsmol.zipwithin the unpacked Jmol folder. -
In the Terminal program, navigate into the unpacked jsmol folder. It will be something like
cd /Users/Me/Downloads/jmol-14.2.12/jsmol(Note on a Mac you can drag folder icon from within the Finder program gui to after
cdin Terminal.) -
Issue command below to start the server
python -m SimpleHTTPServer -
You'll see something like
Serving HTTP on 0.0.0.0 port 8000 .... You need that port number. Default is generally8000. -
In your Chrome browser, enter a URL similar to below using the port number you observed in Terminal after the colon.
http://localhost:8000 -
Select a page, such as
test2.htm, and open it. JSmol should run in Chrome without issuing aNetworkError. -
Back in the Terminal window you'll see reports as you communicate with the server from the browser.
-
Type
ctrl-c(Controlkey held down while pressingckey) in terminal to exit running server.