• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling applets function from javascript

 
shahabas shabeer
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,

How can I call an applets function from javascript.The applet is inside an object tag.
hare is the code that i wrote in my html page
<OBJECT "classid="clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA" width="100%" height="100%" codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0"> <NOEMBED><XMP>
<applet name="appletname" code="abc.def.class" codebase="." archive="xx.jar" width="100%" height="100%" >
</applet>
</XMP>

</NOEMBED></EMBED>
</OBJECT>

*****
I tried the code
document.appletname.appletfunction() in javascript
but It is not working
please help.
Thanks in advance.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi shahabas
You should use ID attribute of the OBJECT tag to invoke methods on the applet.
I should warn you that applet's method calling in Netscape/Mozilla browsers using EMBED tag instead of OBJECt will not work.
Thanks
Maulin
 
Kelly Dolan
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where you able to successfully do this? I am trying to do the same thing, I am using the ID on the OBJECT tag, I'm not worried about Netscape and it is not working.

Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic