• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 174
  • Last Modified:

urgent display text from applet using jscript

I have an applet called myApplet with the property

String getLeaseName () { return leaseName; }

At the beginning of the page I need to write out this data

document.myApplet.getLeaseName();

what is the html to write this out
0
nick5454
Asked:
nick5454
1 Solution
 
cheekycjCommented:
try this:
<script>
var leaseName = document.MyApplet.getLeaseName();
document.write(leaseName);
</script>

CJ
0
 
objectsCommented:
That script is correct, but may fail due to it being executed before the applet has completed loading.

To ensure it works, instead have the applet call a js method. This will avoid the problem of the applet not having completed loading.

Use the following Java code to call a JS function:

JSObject window = JSObject.getWindow(applet);
window.call(functionname, args);

You will also need to include the MAYSCRIPT parameter in your applet tag.
0
 
nick5454Author Commented:
Isnt there a possibility of the user disabling MAYSCRIPT?
0
 
objectsCommented:
Not MAYSCRIPT directly, but they can disable both Java and Javascript.
0
 
girionisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to objects

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now