From: Bob H. <ha...@st...> - 2007-04-25 01:59:37
|
Harini. You present yourself a challenge, since different browsers require different configurations of these tags. Most likely some user platforms will not load your page. But if you feel you really cannot use Jmol.js, then at least use it once and have it display the proper tag for you. Just use this once to see what it gives, then cut and paste:: Just from you hard drive -- just to see what the code is supposed to look like: <script src=Jmol.js></script> <script> jmolSetDocument(0) s = jmolApplet(400) document.write("<pre>"+s.replace(/\</g, "<")+"</pre>") </script> or, if you wish to force the <applet> tag instead of <object>: <script src=Jmol.js></script> <script> jmolInitialize(".") _jmol.useIEObject = false; _jmol.useHtml4Object = false; jmolSetDocument(0) s = jmolApplet(400) document.write("<pre>"+s.replace(/\</g, "<")+"</pre>") </script> Harini Gopalakrishnan wrote: >Hi, > >I am trying to embed the applet tag in my html page >and I encounter the "Class not found Exception". >I have set the codebase to point to the URL where my >JmolApplet.jar resides and it still refuses to locate >the class. Can anyone help me figure as to what the >problem could be? The applet does load if I make use >of the Jmol.js script but for other reasons I would >want to embed the applet tag directly instead of >making a call to the javascript. > >The snippet of the code I use to load my applet is a s >follows: > ><body> ><applet code='JmolApplet.class' >codebase='http://rna.informatics.indiana.edu/cgi-bin/hgopalak/jmol' >archive='JmolApplet.jar' width='200' height='350'> ><param name='loadInline' value=''> ></applet> ></body></html> > > > With forcing, Jmol.js will produce this: <applet name='jmolApplet0' id='jmolApplet0' code='JmolApplet' archive='JmolApplet0.jar' codebase='.' width='400' height='400' mayscript='true'> <param name='progressbar' value='true' /> <param name='progresscolor' value='blue' /> <param name='boxbgcolor' value='black' /> <param name='boxfgcolor' value='white' /> <param name='boxmessage' value='Downloading JmolApplet ...' /> <param name='script' value='select *' /> <table bgcolor='yellow'><tr><td align='center' valign='middle' width='400' height='400' > You do not have the<br /> Java Runtime Environment<br /> installed for applet support.<br /> Visit <a href='http://www.java.com'>www.java.com</a></td></tr></table></applet> >The error thrown is as follows: > >load: class JmolApplet.class not found. >java.lang.ClassNotFoundException: JmolApplet.class >at sun.applet.AppletClassLoader.findClass(Unknown >Source) >at java.lang.ClassLoader.loadClass(Unknown Source) >at sun.applet.AppletClassLoader.loadClass(Unknown >Source) >at java.lang.ClassLoader.loadClass(Unknown Source) >at sun.applet.AppletClassLoader.loadCode(Unknown >Source) >at sun.applet.AppletPanel.createApplet(Unknown Source) >at sun.plugin.AppletViewer.createApplet(Unknown >Source) >at sun.applet.AppletPanel.runLoader(Unknown Source) >at sun.applet.AppletPanel.run(Unknown Source) >at java.lang.Thread.run(Unknown Source) >Caused by: java.io.IOException: open HTTP connection >failed. >at sun.applet.AppletClassLoader.getBytes(Unknown >Source) >at sun.applet.AppletClassLoader.access$100(Unknown >Source) >at sun.applet.AppletClassLoader$1.run(Unknown Source) >at java.security.AccessController.doPrivileged(Native >Method) >... 10 more > >Thanks, >Harini > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com > >------------------------------------------------------------------------- >This SF.net email is sponsored by DB2 Express >Download DB2 Express C - the FREE version of DB2 express and take >control of your XML. No limits. Just data. Click to get it now. >http://sourceforge.net/powerbar/db2/ >_______________________________________________ >Jmol-users mailing list >Jmo...@li... >https://lists.sourceforge.net/lists/listinfo/jmol-users > > |