This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Accessing applet string from javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Accessing applet string from javascript" Watch "Accessing applet string from javascript" New topic

Accessing applet string from javascript

Gary Damschen

Joined: May 02, 2003
Posts: 3
I need to check for whether or not applet scripting is enabled in a user's browser. I can check for javascript being enabled and Java being enabled, but I do not seem to be able to reliably verify that the ability to script an applet is enabled. My Java is a bit rusty, but I have an applet (see below) that displays the word "Enabled" in the browser. I want to access that string in the applet from the browser using JavaScript to verify that scripting is enabled, but I can't seem to access the currStatus string from the applet. Any suggestions?
Here are the relevant code snippets...
Java applet:

ASP page code:
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
There are a couple classes within the netscape.javascript package that allow an applet to talk to javascript and vice versa. Take a look at this thread for some more information.
I hope that helps,

SCJP Tipline, etc.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
Hello there, you can change properties with the applet rather easily, look at this post and see if this will help you
It is sorta covered in the JavaRanch Style Guide.
subject: Accessing applet string from javascript