• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to call applet methods from javascript

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I am trying to load an applet available inside a signed jar file from a html file. When i try to access the methods available in the applet,
i am facing errors like test() is not a function.

The applet code used is:

The javascript code is:


The applet code in html is :




Kindly tell me where should i place the applet class files and the signed jar file.

At present i have placed it inside the web-inf folder.

Kindly provide me a solution.

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i am facing errors like test() is not a function.


That's probably because the applet does not have a method called "test".

var applet = document.getElementsByName('testApplet')[0];


What value does "applet" have at this point?

Kindly tell me where should i place the applet class files and the signed jar file. At present i have placed it inside the web-inf folder.


Nothing that's inside WEB-INF will be served to the client. Put it in the same directory as the HTML file containing the applet tag.
 
rajesh anguraj
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a method test in my applet. Here in the code , by mistake i put the method name as Test, it is actually test()
 
rajesh anguraj
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When i give alert message say alert(applet), i get it as object<AppletHTMLElement>.

I have placed the class files along with my html files.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic