This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to call applet methods from javascript

 
rajesh anguraj
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • 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.

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic