See also:


Anton Vasetenkov
Web, data, bio, language.

JSmol is a JavaScript library for displaying three-dimensional chemical structures. It uses HTML5 features to render interactive 3D models and supports the same scripting language as Jmol.

Using JSmol

const appletKey = 'myJmol'
const JmolInfo = {
    width: 500,
    height: 500,
    color: 'BACKGROUND_COLOR',
    j2sPath: 'PATH_TO_J2S',
    serverURL: 'PATH_TO_JSMOL_PHP',
    use: 'html5'
const appletHtml = window.Jmol.getAppletHtml(appletKey, JmolInfo)
document.body.innerHTML += appletHtml
window.Jmol.script(window[appletKey], 'load PATH_TO_STRUCTURE')
window.Jmol.script(window[appletKey], 'background red')

Further reading

For more detailed instructions on how to use Jmol, go to its official site and wiki.

See also