Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

frames html and ajax

Tags:

html

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

like image 319
sahil Avatar asked Nov 30 '25 17:11

sahil


2 Answers

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.

like image 105
Darin Dimitrov Avatar answered Dec 02 '25 07:12

Darin Dimitrov


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')

like image 34
Ghyath Serhal Avatar answered Dec 02 '25 08:12

Ghyath Serhal