self.location.href的具体用法
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/15 18:30:24
self.location.href的具体用法
self指代当前窗口对象,属于window最上层的对象;
location.href 指的是某window对象的URL地址.
self.location.href指当前窗口的URL地址,去掉self默认为当前窗口的URL地址.
一般用于防止外部引用,如果你的网页地址是:
if(top.location.href!=self.location.href){
location.href="http://www.a.com";
}
来转向你的页面,
top指代的是主体窗口,这里top.location.href返回http://www.b.com;
http://www.b.com!=http://www.a.com,返回为真(true),则网页重定向到你的网页,做到防盗用的作用.
location.href 指的是某window对象的URL地址.
self.location.href指当前窗口的URL地址,去掉self默认为当前窗口的URL地址.
一般用于防止外部引用,如果你的网页地址是:
if(top.location.href!=self.location.href){
location.href="http://www.a.com";
}
来转向你的页面,
top指代的是主体窗口,这里top.location.href返回http://www.b.com;
http://www.b.com!=http://www.a.com,返回为真(true),则网页重定向到你的网页,做到防盗用的作用.
self.location.href的具体用法
window.location.href的用法
window.location.href 和self.location的区别
if (top = self)top.location.href = "Admin_Login.
请问在javascript中top.location.href 与 location.href的区别是什么?
top.contents.location.href
document.location.href.substring
document.location.href.toLowerCase()是什么意思
我要在的href里填写一段由window.location.href获得的地址,怎么编写?
标签里href属性的用法,
window.top.location.href='/index.jsp';
else语句是登录的判断过程,主要代码如下:alert("用户名不能为空!");window.location.href