Borrowed JSmol

From Jmol
Revision as of 17:44, 18 December 2015 by AngelHerraez (talk | contribs) (Borrowed JSmol)
Jump to navigation Jump to search

This page collects methods for displaying structures in JSmol on the web without actually having control of a web server.

Hosting JSmol pages in a cloud service


Display using JSmol of structures uploaded to a cloud service

There are 2 parts here:

  • where the page that embeds the JSmol object is located (a common resource),
  • where the file with the molecule or structure is located (your personal file)

An idea picked from Quick way to share interactive molecular structures and animations by Jan Jensen (licensed under Creative Commons Attribution 4.0)

JSmol display

Display of the molecular structure in a JSmol panel is achieved via this page:

with a special syntax in the URL: you must append the ?source= token followed by the url of your molecular file (see examples below).

The URL may easily be copied and shared by email, Tweet, blog or any other means to whoever you want to show your molecular model to. Since all data are in public servers and the page uses JSmol/html5, it is most likely that ayone can view it on any platform, without installing or learning any software.

If you want to share a customized view of your molecule (not just the default ball & stick rendering), the way to follow is to write a small script file that will load the molecule and then apply any Jmol scripting. Then your link should use the url of that script file rather than the molecular file. See details below.


Once your molecular file has been uploaded to figshare, copy the link to it (it may be in any file format that Jmol accepts, like the most common pdb and mol formats). For example:

link to file
url for JSmol display

(Thanks to @janhjensen for the tip)


Once your molecular file has been uploaded to Dropbox, you need a trick:

Change the regular link, of the form

to this form:

and then append it to the JSmol url:

link to file
url for JSmol display

(Thanks to @janhjensen and @aminophen for the tip)

Other servers

It may also be possible to use any other web server, as long as you can grab a permanent url that directly points to your file.

= Custom displays via script