location.href的几种用法

self.location.href;

window.location.href;

this.location.href;

location.href;

parent.location.href;

top.location.href;

window.location.href与location.href,self.location.href,location.href都是本页面跳转

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

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

时间: 2024-08-02 23:13:00

location.href的几种用法的相关文章

javascript中的location.href有很多种用法

javascript中的location.href有很多种用法,主要如下. self.location.href="/url" 当前页面打开URL页面 location.href="/url" 当前页面打开URL页面 windows.location.href="/url" 当前页面打开URL页面,前面三个用法相同. this.location.href="/url" 当前页面打开URL页面 parent.location.h

超文本引用href的几种用法

href="要跳转目标链接"; href="#";当前页面不跳转(返回顶部) href="###";当前页面不跳转(同时不回到顶部) href="javascript:;";当前页面不跳转,返回空 href="javscript:void(0);";当前页面不跳转,无返回值 href="javasript:alert("hello world");" href=&qu

js中location.href的用法

常用的location.href的几种形式: self.location.href; window.location.href; this.location.href; location.href; parent.location.href; top.location.href; 举例: a.html: <form id="form1" action=""> <div><strong>这是a.html页面<strong>

window.location.href的用法(动态输出跳转)(转)

无论在静态页面还是动态输出页面中window.location.href都是不错的用了跳转的实现方案 javascript中的location.href有很多种用法,主要如下. self.location.href="/url" 当前页面打开URL页面location.href="/url" 当前页面打开URL页面windows.location.href="/url" 当前页面打开URL页面,前面三个用法相同.this.location.hre

详解location.href几种用法的区别【JS跳转】

一:提出问题 使用js的同学一定知道js的location.href的作用是什么,但是在js中关于location.href的用法究竟有哪几种,究竟有哪些区别,估计很多人都不知道了. 二:常见的几种形式 目前在开发中经常要用到的几种形式有: 1 self.location.href; 2 window.location.href; 3 this.location.href; 4 location.href; 5 parent.location.href; 6 top.location.href;

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

使用js的同学一定知道js的location.href的作用是什么,但是在js中关于location.href的用法究竟有哪几种,究竟有哪些区别,估计很多人都不知道了. 一.location.href常见的几种形式 目前在开发中经常要用到的几种形式有: 1 2 3 4 5 6 self.location.href;//当前页面打开URL页面 window.location.href;//当前页面打开URL页面 this.location.href;//当前页面打开URL页面 location.h

location.href的用法

location.href的用法 *.location.href 用法: top.location.href=”url”          在顶层页面打开url(跳出框架) self.location.href=”url”         仅在本页面打开url地址 parent.location.href=”url”     在父窗口打开Url地址 this.location.href=”url”     用法和self的用法一致     if (top.location == self.loc

关于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" 是最外层的页面跳转. 举例说明: 如果A,B,C,D都是html,D

*.location.href 用法:

*.location.href 用法: top.location.href=”url”          在顶层页面打开url(跳出框架) self.location.href=”url”         仅在本页面打开url地址 parent.location.href=”url”     在父窗口打开Url地址 this.location.href=”url”     用法和self的用法一致     if (top.location == self.location) 判断当前locati