window.location.href

JavaScript

window.location.href的用法是什么?

232 0

window.location 对象可用于获取当前页面地址(URL)并把浏览器重定向到新页面。window.location 对象可不带 window 前缀书写。window.location.hrefwindow.location.href 属性返回当前页面的 URL。在js中,window.location.href经常用于页面跳转。它主要有如下几种用法:1、在当前页面打开URL页面。需要注意的是window.location.href=window.location.href与window.loca