sarafi浏览器iframe跨域cookie无效的处理方案(笨方法,看官莫笑)
2016-01-15 17:50
260 查看
<script> $(function(){ url = 'oauth_authorize_api'; loaded = false; iframe = '<iframe id="login" width="100%" height="500" src="' + url + '"></iframe>'; $(".test").click(function(){ if(loaded) return false; if(!/chrome\/\d+/.test(navigator.userAgent.toLowerCase()) && /safari\/\d+/.test(navigator.userAgent.toLowerCase())) { myWindow = window.open(url,"myWindow",'width=1,height=1'); setTimeout(function(){ myWindow.close(); $("#iframe").append(iframe); },1000); } else { $("#iframe").append(iframe); } loaded = true; }); }) </script> <a class="test" href="#">登录</a> <div id="iframe"></div>
相关文章推荐
- 解决 未能从程序集“System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”中加载
- 到处Android安装程序的 apk
- android SQLiteOpenHelper(数据库)
- shell--学习 sed
- springBoot上传文件大小设置
- Linux命令学习手册-iconv命令
- Retrofit 源码解读之离线缓存策略的实现
- Tomcat的shezhisession超时的几种方式
- Failed to code sign ios开发工程跑不起来之 显示UUID
- Fragment
- 子DIY浮动高度超过父DIV导致父DIV高度变为0
- IOS状态栏和导航栏的控制问题
- sicily 递归练习 1005. Arithmetic Expression Evaluation
- linux环境下gsoap调用过程中的超时设置
- 设置linux环境变量LANG
- Java提高学习之Object(2)
- ALLEGRO 问题累积
- embedded.mobileprovision文件decode命令
- 使用js创建select option
- 自定义控件点滴3(字体相关)