老字号餐厅将福寿螺当田螺卖 官方称已立案调查
时间:2024-09-11 09:24:02
通過JavaScript的location對象,可獲取URL中的協(xié)議、主機名、端口、錨點、查詢參數(shù)等信息。
示例
URL:http://www.akmsg.com/WebDemo/URLParsing.html#top?username=admin&pwd=123456
解析結(jié)果:
代碼
console.log( 'location.hash :' + location.hash + '\r\n' + 'location.host :' + location.host + '\r\n' + 'location.hostname :' + location.hostname + '\r\n' + 'location.href :' + location.href + '\r\n' + 'location.pathname :' + location.pathname + '\r\n' + 'location.port :' + location.port + '\r\n' + 'location.protocol :' + location.protocol + '\r\n' + 'location.hash :' + location.hash + '\r\n' + 'location.search :' + location.search + '\r\n' + 'location.origin :' + location.origin )
在線示例
地址:http://www.akmsg.com/WebDemo/URLParsing.html
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
本文如未解决您的问题请添加抖音号:51dongshi(抖音搜索懂视),直接咨询即可。