关于iframe 跨域,该如何处理

WBOY
Release: 2016-06-13 13:52:21
Original
1049 people have browsed it

关于iframe 跨域

关于iframe 跨域

一个页面a.htm 有一个 iframe iframe1,iframe1 里是b.hml, b.hml 里有一个 iframe2, 如何获得 iframe2的 的body.innerhtml 了 


window.frames['iframe1'].document.body.innerHTML;

这是获取第一个 iframe的 可是要获取 iframe2的  

该怎么获取了 

跨域吗? 如何实现了

------解决方案--------------------
jquery 的jsonp可以解决

跟iframe无关
------解决方案--------------------
这个跟“域”没有关系,域是指“a.com”到“b.com”

你这个看看js的parents,document之类的层次关系就可以了

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!