Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

writing from iframe to the outside web page

Tags:

jquery

HI, I have a iframe in my web site and i need to write something in to a div outside of the iframe when a button is clicked, this is not working with the regular

$('#id').html("write something");

any ideas how to do this? Thank you very much

like image 902
Ovi Avatar asked May 26 '11 12:05

Ovi


People also ask

How do I show an external website inside another page without an iframe?

We can use the object tag in HTML to embed external resources in the webpage. We can use the tag to display another webpage in our webpage. The object tag is an alternative to the iframe tag in HTML. We can use the tag to embed different multimedia components like image, video, audio, etc.

How to display one HTML page inside another?

HTML Iframe SyntaxThe HTML <iframe> tag specifies an inline frame. An inline frame is used to embed another document within the current HTML document.

How do I use an iframe to find a specific part of a Web page?

Set the iframe to the appropriate width and height and set the scrolling attribute to "no". If the area you want is not in the top-left portion of the page, you can scroll the content to the appropriate area.


1 Answers

$('#id', window.parent.document).html('write something');

Obviously this assumes that the parent and the iframe are on the same domain otherwise you will not be able to manipulate the parent from the child neither the parent will be able to manipulate the child (if they are not from the same family :-))

like image 189
Darin Dimitrov Avatar answered Oct 07 '22 20:10

Darin Dimitrov