-4

I have recently been working on a project that includes 2 iframes, one of which contains a button. When that button is clicked, the next iframe should be reloaded. How can I do that? Any help will be appreciated.

Actually that's my problem. The code is huge and I can't paste it. I don't think even if I paste it you would read it all! So, please try and understand what I am about to explain.

I have a page with 2 iframes in it. The first iframe contains a button with the attribute src='notification.php' and the second iframe contains 'contactlist.php'.

The problem is that I am trying to reload/refresh the second iframe when user clicks the button in the first iframe.

I tried to make a javascript function in the main page but that didn't work.

Octahedron
  • 893
  • 2
  • 16
  • 31
  • Actually that's my problem . The code is huge and i can't paste it . I don't think even if i paste it you would read it all :D So , Please try and understand what i am going to explain . I have a page with 2 iframes in it . 1 iframe contains a button whose src='notification.php' – user1820264 Nov 13 '12 at 09:27
  • 2
    If you can't understand what the code does, create a more simple example that you can understand. When the simple example works, try to fix the original code. – Aaron Digulla Nov 13 '12 at 12:57

1 Answers1

1

Create a JavaScript function in the parent window which reloads the second frame and call that function from the first.

Note that for this to work, the first frame and the parent window must be in the same domain (Same Origin Policy)

Related: Calling a parent window function from an iframe

Community
  • 1
  • 1
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820