简体   繁体   中英

customization cross-domain iFrame

I need to get acceess to css in iFrame. I read some articles and questions on the SO. And all people say that this is impossible. Because this is other world. I found the following example: demo

Can somebody explains how it works and it's really cross-domain?

Thanks.

This page is made of three pages.

In order for all this to work, the contain page needs to push "messages", and the iframes need to listen to them.

On container page, changes get pushed around via

 var elem = document.getElementById('innerFrameProxy');
 elem.contentWindow.location = 'http://www.pie ... meProxy.html#' + message;

The iframe pages have

 function ForwardMessage() {
     var message = document.location.hash;

which is always ready pick up changes.

The iframes changed look and feel because they were setup to do so, it not because they forced to

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM