port 屬性是一個可讀可寫的字符串,可設(shè)置或返回當前 URL 的端口部分。
location.port=portnumber
假設(shè)當前的 URL 是: http://example.com:1234/test.htm#part2:
<html> <body> <script type="text/javascript"> document.write(location.port); </script> </body> </html>
輸出:
1234
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答??! 點擊進入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號