Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

JavaScript - Swing Applet communication

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..


 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raghav -
You are too kind! -j
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic