Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript - Swing Applet communication

 
Raghvendra Sharma
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there,
I am facing this problem of interaction between my JApplet and the javascript code. The javascript code doesn't recognize the applet as an object. It says, document.<appletname> is not an object.
But when i do it with Applet (not japplet) it works fine.
Is this a limitation of javascript to identify only applets and not japplets ? or is there some hidden trick involved.
I am using jdk1.3, java plug in 1.3.0-C on IE 5.5.
What do i do ?? Any helps..
regards
raghav..
 
Jay Lockwood
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same problem; were you fortunate enough to solve yours? A code snipet would be appreciated.
Regards,
jay

Originally posted by Raghvendra Sharma:
hi there,
I am facing this problem of interaction between my JApplet and the javascript code. The javascript code doesn't recognize the applet as an object. It says, document.<appletname> is not an object.
What do i do ?? Any helps..
regards
raghav..

 
Christophe Monnet
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try document.applets["<AppletName>"] instead of document.<AppletName>

document.applets[0] should work as well.

Also in the <OBJECT> tag don't forget to add this line:
<PARAM NAME="scriptable" VALUE="true">
 
Raghvendra Sharma
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,
Christophe is quite correct in saying that.
The scriptable = true is truly required.
And of course both of document.AppletName and
document.applets[0] or document.applets[AppletName] would work just fine in case of IE.
raghav..
 
Jay Lockwood
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much for all replys.
I'm convinced my problem is not related to the JavaScript, HTML, nor Java. The following example from Sun also fails on my desktop:
http://forum.java.sun.com/thread.jsp?forum=30&thread=168544
I suspect my best chance for help will be Sun. Thanks again.
Regards,
jay
 
Raghvendra Sharma
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't you worry Jay.
ALthough I am not sun, I hope I'll be able to help you.
Given a few days.
 
Jay Lockwood
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raghav -
You are too kind! -j
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic