JS 跳出iframe框架
2021腾讯云限时秒杀,爆款1核2G云服务器298元/3年!(领取2860元代金券),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1062
2021阿里云最低价产品入口+领取代金券(老用户3折起),
入口地址:https://www.aliyun.com/minisite/goods
top.location.href='url'
友情提示
TabPanel的属于里layoutOnTabChange:true,这个是一定要加的
每一个tab的布局用着fit。
或者tab用bordel布局..grid设成region:'center'
JS 跳出iframe框架,退出JS 2010-10-18 15:31:57 阅读348 评论1 字号:大中小 订阅
(1)session过期后登陆页面跳出iframe页面问题
登陆页面增加javascript:
function window.onload()
{
if(window.parent.length>0)
window.parent.location=location;
}
或者:
<script>
if (window != top)
top.location.href = location.href;
</script>
(2)自动跳出iframe的代码
<script type="text/javascript">
if (top.location !== self.location) {
top.location=self.location;
}
</script>
(3)在框架页内的退出操作:
<script type="text/javascript">
if (top.location !== self.location) {
top.location = "../index.jsp";//跳出框架,并回到首页
}
</script>
跳出多级iframe
我知道一个ifame中的跳出框架的方法
JScript code
function gotoLogin(){
if(self.frameElement && self.frameElement.tagName=="FRAME"){
// 页面在iframe中时处理
window.parent.location = "${pageContext.request.contextPath}/login.jsp";
}else{
window.location = "${pageContext.request.contextPath}/login.jsp";
}
}
但是我ifame中又套了一个ifame 这个页面如何跳出啊?
我的页面流程是超时显示超时页面--》点击链接回到登陆页面
--------------------------------------------------------------------------------
二楼正解~~~
--------------------------------------------------------------------------------
搞定结贴!
JScript code
function gotoLogin(){
var t = self.frameElement;
if(t && (t.tagName=="FRAME"||t.tagName=="IFRAME")){
// 页面在iframe中时处理
window.top.location = "${pageContext.request.contextPath}/login.jsp";
}else{
window.location = "${pageContext.request.contextPath}/login.jsp";
}
}
(1)session过期后登陆页面跳出iframe页面问题 登陆页面增加javascript: function window.onload() ??? { ??????? if(window.parent.length>0) ???????? window.
相关阅读排行
- 1JS 跳出iframe框架
- 2移动WebApp开发 JS框架对比
- 3Node.js日志框架选型比较:Winston
- 4js调用父框架函数与弹窗调用父页面函数的方法
- 5基于asp.net + easyui框架,js实现上传图片之前判断图片格式,同时实现预览,兼容各种浏览器+下载