sahil
sahil

Reputation: 1126

frames html and ajax

I have 3 frames in a html page. In one frame, i am sending ajax request. Now I want to update the data sent by server in other frame. Is it possible

Upvotes: 3

Views: 1885

Answers (2)

Ghyath Serhal
Ghyath Serhal

Reputation: 7632

Of course this is possible. From the iframe you can access the parent windows using the 'parent' object. so from the 'frame1' you can write parent.getElementById('frame2').contentDocument.getElementById('id of the control in frame2')

Upvotes: 2

Darin Dimitrov
Darin Dimitrov

Reputation: 1038920

If those frames are on the same domain here's an example how to call function from one frame to another. So once the AJAX request completes in the first frame you could call a javascript function on the second frame which will take care of updating the contents. If the frames are not on the same domain this is not permitted for security reasons.

Upvotes: 4

Related Questions