window.location与window.open()的区别
"top.location.href"是最外层的页面跳转
"window.location.href"、"location.href"是本页面跳转
"parent.location.href"是上一层页面跳转.
location是window对象的属性,而所有的网页下的对象都是属于window作用域链中(这是顶级作用域),所以使用时是可以省略window。而top是指向顶级窗口对象,parent是指向父级窗口对象。
window.location是window对象的属性,而window.open是window对象的方法
window.location是你对当前浏览器窗口的URL地址对象的参考!
window.open是用来打开一个新窗口的函数!
window.open()是可以在一个网站上打开另外的一个网站的地址
而window.location()是只能在一个网站中打开本网站的网页
window.location或window.open如何指定target?
这是一个经常遇到的问题,特别是在用frame框架的时候
解决办法:
window.location 改为 top.location 即可在顶部链接到指定页
或
window.open("你的网址","_top");
<input type="button" value="新窗口打开" onclick="window.open('http://www.baidu.com')">
<input type="button" value="当前页打开" onclick="top.location='http://www.baidu.com','_top'">
window.location与window.open()的区别的更多相关文章
- windows.open window.location.href的用法和区别
window.location.href 只能在当前页面打开,不能用新窗口打开 windows.open("URL","窗口名称","窗口外观设定& ...
- window.location 与window.open区别
window.location 与window.open区别 1.window.location是window对象的属性,而window.open是window对象的方法 window.locat ...
- window.location.href = window.location.href 跳转无反应 a 超链接 onclick 点击跳转无反应
错误写法 , 主要是在 href="#"这里 <a href="#" id="send" onclick="return b ...
- window.location和window.open
window.location和window.open的区别 window.location = "http://www.baidu.com" 跳转后有后退功能 window.lo ...
- window.location和window.location.href和document.location的关系
1,首先来区分window.location和window.location.href. window.location.href是一个字符串. 而window.location是一个对象,包含属性有 ...
- window.location.href = window.location.href window.location.reload()
w 0-会议预订提交了预订日期,预订成功后默认显示仅显示当前日期的新页面若显示预定日的信息,则可以对预定日存入cookie: http://stackoverflow.com/questions/24 ...
- JS中 window.location 与window.location.href的区别
疑惑:window.location='url' 与window.lcoation.href='url'效果一样,都会跳转到新页面,区别在哪?查得的资料如下: 1:window.location是页 ...
- js 中实现页面跳转的方法(window.location和window.open的区别)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...
- window.location和window.open的区别
window.location = "http://www.baidu.com" 跳转后有后退功能 window.location.replace("http://www ...
随机推荐
- 从库函数解析STM32地址映射
STM32的存储映射是靠基地址和地址偏移实现的. 32位的M3有4GB的寻址空间,其中用于片上外设的有512MB,基地址为0x40000000. M3各外设基地址,包括片上外设.片上静态RAM和FLA ...
- 【Oracle】OGG数据初始化之RMAN
实验环境: 源端.目标端: DataBase:10.2.0.1.0 OS:OEL5.6 OGG:fbo_ggs_Linux_x86_ora11g_32bit 源端使用rman进行备份全库: RMAN& ...
- 如何使用django中的cookie和session?
1.Cookie 介绍 Cookie是由服务器端生成,发送给User-Agent(一般是浏览器),浏览器会将Cookie的key/value保存到某个目录下的文本文件内,下次请求同一网站时就发送该Co ...
- (转载)undo表空间
对Oracle数据库UNDO表空间的监控和管理是我们日常最重要的工作之一,UNDO表空间通常都是Oracle自动化管理(通过undo_management初始化参数确定):UNDO表空间是用于存储DM ...
- php源码安装,并配置apache支持php
一.php安装准备环境 yum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-deve ...
- 关于python中的查询数据库内容中用到的fetchone()函数和fetchall()函数(转)还有fetchmany()
最近在用python操作mysql数据库时,碰到了下面这两个函数,标记一下: fetchone() : 返回单个的元组,也就是一条记录(row),如果没有结果 则返回 None fetchall() ...
- hibernate validator 验证
@AssertTrue 用于boolean字段,该字段只能为true @AssertFalse 该字段的值只能为false @CreditCardNumber 对信用卡号进行一个大致的验证 @De ...
- springboot-vue项目后台2---pojo对查询结果手动分组
<resultMap id="PResult" type="packs" > <result column="device_type ...
- 网络管理常用命令(6/14) -netstat命令详解
Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多播成员 (Multicast Membershi ...
- Tomcat在windows服务器下,将tomcat控制台日志记录到日志文件中
Tomcat在windows服务器下,将tomcat控制台日志记录到日志文件中 在Linux系统中,Tomcat 启动后默认将很多信息都写入到 catalina.out 文件中,我们可以通过tail ...