aspose file tools*
The moose likes Applets and the fly likes pass parameter to applet in another window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "pass parameter to applet in another window" Watch "pass parameter to applet in another window" New topic
Author

pass parameter to applet in another window

Chad Clites
Ranch Hand

Joined: Aug 16, 2005
Posts: 134
Is it possible to load an applet in a new window, and pass it a (dynamic) parameter? I can do it using javascript if everything is in the same window, but I can't figure out if it is possible to pass parameters to a different window. I am trying to add some functionality to a pre-existing web site, and my only option (that I an think of) is to use javascript. I can't tinker with the html without causing huge problems.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42631
    
  65
You could try appending a parameter to the URL of the page that contains the applet, and then read that via "getDocumentBase" in the applet. I think that should return the full URL of the page, including the parameter.


Ping & DNS - my free Android networking tools app
Chad Clites
Ranch Hand

Joined: Aug 16, 2005
Posts: 134
I did finally find a javascript method. In my new window, I use document.opener.my_element.my_value. That gets the element I need from the parent window. I've been trying to figure this out for two weeks, and it turned out to be a simple one-line piece of code. :roll:
 
Don't get me started about those stupid light bulbs.
 
subject: pass parameter to applet in another window