JavaScript中的window.location的使用

window.location對象可以用於獲取當前頁面地址(url),並把瀏覽器重定向到新頁面 location對象的屬性與對應的屬性值: window.location.href 返回當前頁面的href(url) window.location.hostname 返回web主機的域名 window.location.pathname 返回當前頁面的路徑或者文件名 window.location.
相關文章
相關標籤/搜索