1. window.location.href 瀏覽器地址欄中的完整地址串
2.window.location.pathname URL的路徑部分,請求映射的地址
3.window.location.search 獲得'?'后面的內容
3.window.location.host 獲得主機地址
4.window.location.port 獲取端口號
5.window.location.hash 如果使用了錨點,會返回“#。。。”
如圖所示:
1. window.location.href 瀏覽器地址欄中的完整地址串
2.window.location.pathname URL的路徑部分,請求映射的地址
3.window.location.search 獲得'?'后面的內容
3.window.location.host 獲得主機地址
4.window.location.port 獲取端口號
5.window.location.hash 如果使用了錨點,會返回“#。。。”
如圖所示:
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。