iframe与主框架跨域访问
来源:互联网 发布:淘宝店流量是什么意思 编辑:程序博客网 时间:2024/06/05 00:08
今天遇到一个问题
网页的登录是用的iframe引入,在iframe引入的页面中有一个关闭按钮,需要将主页面弹出的登录页面给关闭,但是登录的页面和主页面不在同一个域下,所以跨域访问产生了问题,百度搜索了一下,才明白iframe跨域需要一个中间过渡页面,现在我就将我试验的过程附上
现在有页面a.html(父页面)
地址是http://localhost/a.html
a.html页面的显示效果
页面b.html(子页面)
地址是:http://abc.sgamer.com/
b.html页面的显示效果
过渡页面aa.html页面代码
讲解一下,a.html和b.html不是同一域下,所以b.html想要对父页面进行操作是不可能的,但是同域下的aa.html可以对a.html进行操作,所以在b.html用iframe请求aa.html页面,aa.html页面的js就是调用a.html里的a方法,所以跨域的问题就解决了
1 0
- iframe与主框架跨域访问
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe与主框架跨域相互访问方法
- iframe跨域访问
- iframe跨域访问
- iframe跨域访问
- Android RecyclerView添加头部与尾部
- 使用cxf整合spring出现Cannot create URL for this address
- 用 LDA 做主题模型:当 MLlib 邂逅 GraphX
- android fragment 标签使用
- 458. poor pigs
- iframe与主框架跨域访问
- Python——os模块
- 在开发中经常用到的一些sql语句,但相对比较复杂一些的
- 66. Plus One
- 【模拟】洛谷 P1423 小玉在游泳
- Spark性能优化指南——基础篇
- 洛谷p3764签到题3
- [转].NET 4.5+项目迁移.NET Core的问题记录 HTTP Error 502.5
- erlang 分布测试【转】