How to upgrade old pages that use the Chem3D Browser Plugin

The Chem3D ActiveX/Plugin replaces the old browser plugin.  This page describes how to upgrade old pages that use the plugin so that they use the new ActiveX/Plugin.  Before proceeding, it may be useful to review this page which describes how web pages can use the ActiveX/Plugin.

This example will use the JavaScript file, and this function from that file:

function c3d_insert3dStr(tagStr)

The old Plugin page uses the <EMBED> tag:

<embed src="ethanolsurfaces.c3d" width="300" height="300" movie_controller_visible="false" rotation_bars_visible="false">

To upgrade to the Chem3D ActiveX/Plugin, put the whole <EMBED> tag in this function as a parameter.  Here is an example:

<script language="javascript">
c3d_insert3dStr("<embed src=\"ethanolsurfaces.c3d\" width=\"300\" height=\"300\" movie_controller_visible=\"false\" rotation_bars_visible=\"false\">");
</script>

NOTE: Because of the JavaScript syntax, you must put an extra slash, \ , right before each double quote, "

Here are the remaining steps:

Include this JavaScript file by putting the following text in your page:

<script language="javascript" src="/jslib/chem3d.js"></script>

The best place for this is between <Head> and </Head>.

Now, put the whole <EMBED> tag in this function as a parameter:

<embed src=...>   ====>  <script language="javascript"> c3d_insert3dStr("<embed src=...>"); </script>

Here is a complete example:

<HTML>
<HEAD>
<TITLE>My Chem3D Model Page</TITLE>
</HEAD>
<BODY>
<embed src="ethanolsurfaces.c3d" width="300" height="300">
</BODY>
</HTML>

 

<HTML>
<HEAD>
<TITLE>My Chem3D Model Page</TITLE>
<script language="javascript" src="/jslib/chem3d.js"></script>
</HEAD>
<BODY>
<script language="javascript"> c3d_insert3dStr("<embed src=\"ethanolsurfaces.c3d\" width=\"300\" height=\"300\">"); </script>
</BODY>
</HTML>

Also, be sure that chem3d.js is in http://yourwebsite/jslib/ .

That's it.  You're finished!