Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing javascript variables to applets

Status
Not open for further replies.

HelenY

Programmer
Dec 22, 2005
2
GB
Hi everyone,

I have a field, whose value I would like to pass to an applet(on the same page) as a parameter. I dont have the value of the field when the page is loaded (it is selected by the user), and I would prefer not to reload the page. Is there any way to do this?

Thanks

Helen
 
This may work, try putting your applet within div tags, give the div an ID then when you want to refresh the applet
call a function that gets your new value and the does the following:

ID.innerHTML = ""; // this should destroy the applet
var strApplet;
strApplet= &quot;<applet name...
strApplet += &quot;<param value=&quot; + yourNewValue + &quot;>&quot;
strApplet += &quot;</applet>&quot;
ID.innerHTML = strApplet; // this should cause it to reload

This MAY work on IE

 
You can set global variables, and call public methods on an Applet.
...
var applet_1 = document.applets[0];
applet_1.setSomething(args);
...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top