`
lever0066
  • 浏览: 54740 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Window Location

阅读更多
"window.location.href"、"location.href"是本页面跳转

"parent.location.href"是上一层页面跳转

"top.location.href"是最外层的页面跳转

举例说明:

如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js这样写

"window.location.href"、"location.href":D页面跳转

"parent.location.href":C页面跳转

"top.location.href":A页面跳转

如果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页面刷新

Window Location
http://www.w3schools.com/js/js_window_location.asp
The window.location object can be written without the window prefix.

Some examples:

    location.hostname returns the domain name of the web host
    location.path returns the path and filename of the current page
    location.port returns the port of the web host (80 or 443)
    location protocol returns the web protocol used (http:// or https://)

Window History
http://www.w3schools.com/js/js_window_history.asp
The window.history object can be written without the window prefix.

To protect the privacy of the users, there are limitations to how JavaScript can access this object.

Some methods:

    history.back() - same as clicking back in the browser
    history.forward() - same as clicking forward in the browser
分享到:
评论

相关推荐

    window.location.href页面跳转的用法(区别于redirect)

    window.location.href页面跳转的用法(区别于redirect)

    javascript 打开页面window.location和window.open的区别.docx

    javascript 打开页面window.location和window.open的区别.docx

    JavaScript Window Location

    JavaScript Window Location [removed] 对象用于获得当前页面的地址 (URL),并把浏览器重定向到新的页面。 Window Location [removed] 对象在编写时可不使用 window 这个前缀。 一些例子: 一些实例: location....

    window.location.hash解析

    NULL 博文链接:https://hugang357.iteye.com/blog/1833003

    详解js location.href和window.open的几种用法和区别.docx

    详解js location.href和window.open的几种用法和区别.docx

    网页跳转代码大全

    window location &quot;http: www admin5 com&quot;;; &lt; script&gt; 如果你要让页面显示几秒钟之后跳转 可以在html代码的&lt;head&gt;&lt; head&gt;部分加上这样的代码: &lt;meta http equiv &quot;refresh&...

    ios不越狱定位,location cleaned防止删除window脚本

    ios不越狱定位,location cleaned防止删除window脚本,在运行location前先运行该脚本(以管理员身份运行),结束后,运行location,即可防止location删除自己提示加Q问题。

    JavaScript编程中window的location与history对象详解

    Window Location [removed] 对象用于获得当前页面的地址 (URL),并把浏览器重定向到新的页面。 [removed] 对象在编写时可不使用 window 这个前缀。 一些例子: 一些实例: location.hostname 返回 web 主机的域名...

    JaswqvaScript 公共类

    url window location href; } var regex ^ w+ : [^ ] ; var match url match regex ; if typeof match &quot;undefined&quot; &amp;&amp; null match { host match[1]; } return host; }"&gt; 1 原生JavaScript...

    WindowBuilder下载,eclipse离线安装(附带步骤)

    Location: jar:file:/F:/temp/repository.zip!/ 4,点击 OK,然后下一步等操作,然后耐心等待安装完成 5,重启eclipse 使用说明: 安装完成后,就可以使用了 1,File &gt;&gt; New &gt;&gt; orther &gt;&gt; windowbuilder 然后选择...

    jQuery开发技巧

    window location $ this find &quot;a&quot; attr &quot;href&quot; ; return false; } ; how to use &lt;div&gt;&lt;a href &quot;index html&quot;&gt;home&lt; a&gt;&lt; div&gt; 17 使用jquery来判断浏览器...

    详解js location.href和window.open的几种用法和区别

    一、location.href常见的几种形式 self.location.href;//当前页面打开URL页面 [removed].href;//当前页面打开URL页面 this.location.href;//当前页面打开URL页面 location.href;// 当前页面打开URL页面 parent....

    js window方法大全

    js window 属性方法大全 Status 窗口状态栏信息,值为yes显示状态栏,no不显示状态栏 window.statusbar. visible 状态栏可见...window.locationbar. visible 地址栏可见返回true,不可见返回false 等等等。。。。。。

    JavaScript_window.setTimeout()_的详细用法

    JavaScript_window.setTimeout()_的详细用法

    jsp 刷新父页面

    window.opener.location.href = window.opener.location.href 刷新以winodw.showModelDialog()方法打开的窗口 window.parent.dialogArguments.document.execCommand('Refresh'); 或 Response.Write("&lt;script&gt;...

    location.href语句与火狐不兼容的问题

    于是我在location前面加了一个 window,即改为: onclick=”[removed].href(‘http://baidu.com’);” 发现仍然不行。 于是去baidu之,找到一个答案: 使用[removed]=”url”; 代替 location.href(‘url’);” 于是...

    获得当前页面的url

    window.location.herf window.location.href location.search; //获取url中"?"符后的字串 document.referrer 获取来路的url,相当于php的$_SERVER['HTTP_REFERER']。 encodeURIComponent() 对url进行转定义,...

    nginx window下的静态文件服务器

    nginx window下的静态文件服务器 location /file/ { alias D:/upload/test/; #换成你的本地磁盘位置 index autoindex on; }

Global site tag (gtag.js) - Google Analytics