Window.location.href () and Window.open () in JavaScript
Window.location.href () and Window.open () in JavaScript
JavaScript
中window.location.href ()
方法和window.open()
方法有什么区别?
window.location
是一个对象和
window.location.href
是它的属性
它告诉您浏览器的当前URL位置
document.write(location.href);// will give location URL location of browser.
设置该属性将重定向页面。
window.open()
是一种方法,您可以将要在新窗口中打开的 URL 传递到
例如
window.location.href = 'http://www.xyz.com'; //Will take you to xyz.
window.open('http://www.xyz.com'); //This will open xyz in a new window.
window.location.href
更改即时窗口位置。
window.open()
将打开一个新窗口。
相关文章:
- window.opener not working in chrome & IE
- window.screen in FireFox
- 使用 window.open in JavaScript 的 URL 中的“/”问题
- Jquery get window.location.search tag in array
- window.find() in Firefox vs Chrome
- 将存储在数组中的 url 传递给 window.open in for loop - Javascript
- Authorization for window.location.href call in angular js
- $(window).on('resize') in JavaScript
- window.open as tabs not pop ups in Chrome
- 函数未在 window.plugins in Angular/Ionic 中运行
- Window.location.href () and Window.open () in JavaScript
- window.open() in Android4.1 and iOS environment
- window.opener is null in firefox
- javascript window.open in safari
- Window.location.reload(true) in CRM 2013
- javascript in IE递归->window.frames不等于它自己
- window.confirm() in java servlet
- Window object in PhantomJS
- Window.location - javascript in php
- window.open() in IE 9