wood burning stoves 2.0*
The moose likes Applets and the fly likes One HTML for running JApplet for both IE and NS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Applets
Bookmark "One HTML for running JApplet for both IE and NS" Watch "One HTML for running JApplet for both IE and NS" New topic
Author

One HTML for running JApplet for both IE and NS

sabbir kazi
Ranch Hand

Joined: Feb 03, 2001
Posts: 62
I understand that you need two different HTML tags in order to run an applet in IE and NS. For IE as follows:
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width ="500" height="500" align="baseline"
codebase="http://java.sun.com/products/plugin/1.2/jinstall-12-win32.cab#Version=1,2,0,0">
<PARAM NAME="code" VALUE="Applet.class">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.2">
</OBJECT>
And for NS:
<EMBED type="application/x-java-applet;version=1.3"
width="500" height="500" align="baseline"
code="Applet.class"
pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html">
</EMBED>
How can you write those two tags into one HTML?
Thanks.
Geoffrey Falk
Ranch Hand

Joined: Aug 17, 2001
Posts: 171
    
    1
You can either use Javascript to detect which type of browser is being used... or else configure your web server to detect the browser type and redirect to the appropriate HTML.
Geoffrey

------------------
Sun Certified Programmer for the Java 2 Platform


Sun Certified Programmer for the Java 2 Platform
Amaresh Patra
Greenhorn

Joined: Sep 14, 2001
Posts: 8
Hi,
A Single HTML file may contain both the tags. IE will ignore embed tag and NS will ignore object tag.
Amaresh
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
HI,
This is a great article giving good explanations and code examples.
http://java.sun.com/products/plugin/1.3/docs/tags.html#IEWin32
Regards,
Manfred.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: One HTML for running JApplet for both IE and NS