0

I have this element on the page:

<iframe src="http://example.com" id="fa-iframe" scrolling="No" frameborder="0" style="height: 513px; width: 597px; "></iframe>

Now, I run jquery within it and try to close it...

The jquery should execute some function on the element...

I tried solutions such as this..but it didnt work:

document.getElementById('fa-iframe').style.display="none";

How do I close the iframe..while the document with the javascript is inside the iframe?

Dmitry Makovetskiyd
  • 6,942
  • 32
  • 100
  • 160
  • Read this - http://stackoverflow.com/questions/726816/how-to-write-this-in-jquery-window-parent-document-getelementbyidparentprice – Jay Blanchard Apr 17 '12 at 13:46

1 Answers1

2

You need to manipulate the DOM of the parent window (parent). This is subject to the same origin policy.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335