Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

calling applets function from javascript

 
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.
 
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
 
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!
 
    Bookmark Topic Watch Topic
  • New Topic