Is it possible? I want an make an adaptive layout but neither CSS or JS can force the iframe content to change from the calling page. However the the iframe pages and the caller use the same CSS and JS file.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This is only possible, if they are from the same origin. It doesn't matter if both use the same CSS or JS file. That means, both are using the same domain name, application layer protocol, and (in most browsers) port number. (Same origin policy)
If you are sure that you fullfil the above mentioned requirements, please check the following links:
- Adding a stylesheet to an iframe
- How to apply CSS to iFrame?
- How to load up CSS files using Javascript?