This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Two Iframe communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Two Iframe communication" Watch "Two Iframe communication" New topic

Two Iframe communication

Frederik Ericsson
Ranch Hand

Joined: Apr 27, 2005
Posts: 128
Hello Friends,

I have a quick question for you guys,

I have an application, one jsp which contains two iframes (two different jsp'es ) one contain applet another normal application. what I want to do is

I want to query the applet status from the second iframe, can you please give the code snippet for communicating between the two iframes

Basically I want to call the first iframes(jsp)'s javascript function from the second Iframe(jsp)

please help me on this issue...
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
var foo = parent.getElementById("yourIframeId").theFunctionThatReturns();

Frederik Ericsson
Ranch Hand

Joined: Apr 27, 2005
Posts: 128

I was not working, I tried it in another way, top.frames['n'].functioname();

It is sorta covered in the JavaRanch Style Guide.
subject: Two Iframe communication
It's not a secret anymore!