BLAH! I did it! It's a painful hack which I am not proud of, BUT:
1. The applet displays in Firefox 1.0.6 and IE 6.
2. There are no broken object icons in either browser.
3. It's valid HTML 4.01 Transitional.
This relies on IE having buggy CSS support (specifically not supporting
the > selector).
<snipped/>
This is Fantastic, Chris!
With the modifications below, I am able to script my applet in the
different browsers too (Opera 8.0, Netscape 7.2, FF 1.0.6 and IE 6)...
The "if (window.XMLHttpRequest) {..." is just a dirty hack to diff
IE from the others...
<style type="text/css">
.notieapplet {
display: none;
}
.appletcontainer > .notieapplet {
display: inline;
}
</style>
<script type="text/javascript">
function setName( name ) {
var myApplet;
// IE does NOT have 'window.XMLHttpRequest'
if (window.XMLHttpRequest) {
myApplet = document.getElementById("helloFF");
} else {
myApplet = document.getElementById("helloIE");
}
myApplet.setName(name);
return true;
}
</script>
</head>
<body>
<div class="appletcontainer">
<object
id="helloFF"
type="application/x-java-applet"
data="no.orion.hello.HelloApplet.class"
width="150"
height="75"
class="notieapplet">
<param name="code" value="no.orion.hello.HelloApplet.class">
<param name="greetName" value="there">
<param name = "mayscript" value ="true"/>
<param name = "scriptable" value = "true">
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
id="helloIE"
type="application/x-java-applet"
data="no.orion.hello.HelloApplet.class"
width="150"
height="75">
<param name="code" value="no.orion.hello.HelloApplet.class">
<param name="greetName" value="there">
<param name = "mayscript" value ="true"/>
<param name = "scriptable" value = "true">
</object>
</object>
</div>
<br />
<input type="button" value="Change Name" onclick="setName('Dag');" />
</body>