location.href、parent.location.href、top.location.href、 window.open
来源:互联网 发布:淘宝怎么用话费支付 编辑:程序博客网 时间:2024/05/22 05:01
"window.location.href"、"location.href"是本页面跳转
"parent.location.href"是上一层页面跳转
"parent.location.href"是上一层页面跳转
"top.location.href"是最外层的页面跳转
//举个例子:如果A,B,C,D都是html,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js这样写
window.open("Url地址","_blank") = window.open("Url地址");//在新窗口打开
location = window.location = location.href = window.location.href =self.location.href = "Url地址";//在D页面实现展现
window.open("Url地址","_self");//在D页面实现展现
parent.location.href = window.parent.location.href ="Url地址";//在C页面实现展现
window.open("Url地址","_parent");//在C页面实现展现
top.location.href = window.top.location.href ="Url地址";//在A页面实现展现
window.open("Url地址","_top")//在A页面实现展现
parent.parent.location = "Url地址";//在B页面实现展现
parent.open("Url地址","_parent") = parent.parent.open("Url地址","_self")//在B页面实现展现
如果D页面中有form的话,
<form>: form提交后D页面跳转
<form target="_blank">: form提交后弹出新页面
<form target="_parent">: form提交后C页面跳转
<form target="_top"> : form提交后A页面跳转
关于页面刷新,D 页面中这样写:
"parent.location.reload();": C页面刷新 (当然,也可以使用子窗口的 opener 对象来获得父窗口的对象:window.opener.document.location.reload(); )
"top.location.reload();": A页面刷新
<form>: form提交后D页面跳转
<form target="_blank">: form提交后弹出新页面
<form target="_parent">: form提交后C页面跳转
<form target="_top"> : form提交后A页面跳转
关于页面刷新,D 页面中这样写:
"parent.location.reload();": C页面刷新 (当然,也可以使用子窗口的 opener 对象来获得父窗口的对象:window.opener.document.location.reload(); )
"top.location.reload();": A页面刷新
0 0
- location.href、parent.location.href、top.location.href、 window.open
- window.location.href parent.location.href top.location.href
- location.href、parent.location.href、top.location.href、 window.open实现页面跳转
- location.href、parent.location.href、top.location.href、 window.open实现页面跳转
- location.href、parent.location.href、top.location.href、 window.open实现页面跳转
- location href、parent location href、top location href、window open实现页面跳转
- location.href、parent.location.href、top.location.href、 window.open实现页面跳转
- location href、parent location href、top location href、window open实现页面跳转
- 关于js中window.location.href,location.href,parent.location.href,top.location.href的用法
- 关于js中window.location.href,location.href,parent.location.href,top.location.href的用法
- 关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法
- 关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法
- js中window.location.href,location.href,parent.location.href,top.location.href的用法
- window.location.href、location.href、parent.location.href、top.location.href
- window.location.href,location.href,parent.location.href,top.location.href用法
- 关于js中window.location.href,location.href,parent.location.href,top.location.href的用法 .
- 关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法
- 关于js中"window.location.href"、"location.href"、"parent.location.href"、"top.location.href"的用法
- 智能提示(三)facet 聚合属性(类别、标签)提示
- 定时任务 Crontab命令 详解
- 中文编码规则一网打尽
- java jar文件的制作方法
- SpriteBuilder中CCMotionStreak提示图片文件找不到
- location.href、parent.location.href、top.location.href、 window.open
- 网站统计中的数据收集原理及实现
- framebuffer开发有我想象的那么简单吗
- OPENWRT-4G-移植-ALT3800
- Codeforces Round #323 (Div. 2) B. Robot's Task(模拟)
- CentOS安装nvidia显卡驱动的正确方法
- 关于用mapreduce做kmeans聚类以及python的numpy和list做矩阵、向量乘法的速度对比
- [Java 程序员]成为优秀Java程序员的10个要点
- [MFC]CTreeView树形视图、CTreeCtrl树形控件