Jmol.php: easy Jmol insertion into a web page
You can insert a Jmol applet into a web page with nothing more than a simple
You don't have to install any Jmol files in your computer or web server.
You don't even need a file with the 3D model; it will be automatically obtained from an appropriate web server.
Note that this way of using Jmol is easily compatible with any environment where you do not control the full source code, like forums, blogs, wikis, content management systems, e-learning environments... In fact, you can email the address and the recipient will see the Jmol applet by clicking on the received link.
If you invoke a PDB 4-character id, the model will be retrieved from the wwPDB (RCSB). If you invoke a chemical name, commercial name, SMILES string, InChI key, or CAS registry number, the model will be retrieved from the CACTVS server (NIH).
You must link to this page
which does all the magic (a courtesy of Bob Hanson and the servers at St. Olaf College). After that URL, text must be added to specify the molecule and some options. Such a text must follow the conventions for URIs, that is:
- first goes a
- then, pairs of name=value
- if more than one name/value pair, they must be separated by an ampersand,
One option among 1 to 3 is needed to define the molecule or model that will be displayed. The others are elective and affect the style of the applet or the model inside it.
source=... the file source of a model, starting with
model=... a name of a chemical, or SMILES string, InChI key, or CAS registry number.
pdbid=... the 4-character ID of the model at the Protein Data Bank (RCSB, wwPDB).
link=... a text to make the hyperlink to a popup window.
script=... a Jmol script (should be simple).
width=... the width of the applet, either in pixels or in percent.
height=... the height of the applet, either in pixels or in percent.
caption=... a caption (only for the anchor type, not with
inlineand not with
title=... a title (not with
Creates a link to a new page with the model in Jmol.
(You can specify the target in the
<a> tag, so that the page either replaces the current one or opens in a new window or tab in the browser)
Creates a link to pop up a new window of a specified size, containing the Jmol applet with the model.
Displays the Jmol applet inserted in the current page.