Doron Sinai
Doron Sinai

Reputation: 1186

embedding a web page in iFrame problem

I embedded a web page in an iFrame like this:

<iframe id="frame" src="http://www.domain.com" width="100%" frameborder="0" marginheight="0" marginwidth="0"></iframe>

Edit: The problem i am having is that the web page javascript is using the top property to find objects but now it is embedded in the iframe, is there a way to over ride this?

Upvotes: 0

Views: 231

Answers (1)

Suyooo
Suyooo

Reputation: 75

If I understand you right, you want to send data from the iFrame to the parent? If so, the error happens because Cross Site Communication is usually blocked to avoid XSS attacks. But you can keep your iframe, and use JavaScript and the window.postMessage(); function to share data.

https://developer.mozilla.org/en/DOM/window.postMessage

Upvotes: 1

Related Questions