More ChemWriter Demos

ChemWriter and Java

Last Updated on Saturday, March 08, 2008.

Working With Java and Web Standards

The HTML 4 <object> tag offers both a standards-compliant, cross-browser method to deploy ChemWriter applets and a failsafe for users who don’t have Java. Any content placed within the <object> tag and after its nested <param> elements will be rendered in the event that the Java plugin can’t be loaded.

When the Java plugin is not present, Firefox and Internet Explorer users will see a dialog offering to install Java directly from the page on which the content appears.

For example, this site presents users with an image indicating that a plugin is missing along with a link to a page with browser-specific instructions for installing/enabling Java.

Code

<!--[if IE]><object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0" width="560" height="350" id="applet" ><script>/*<![endif]--><script type="text/javascript">/**/</script>
<!--[if !IE]><!-->
<object type="application/x-java-applet;version=1.4.2" width="560" height="350" id="applet">
<!--<![endif]-->
  <param name="code" value="com/metamolecular/chemwriter/applet/EditorApplet.class">
  <param name="archive" value = "/applets/chemwriter.jar">
  <a href="/java/">
    <img src="/images/global/chemwriter_plugin.png" class="missingplugin"  />
  </a>
</object>