亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

JavaScript ? ??

JavaScript ? ??

window.location ??? ?? ???? ??(URL)? ???? ????? ? ???? ?????? ? ?????.

Window Location

window.location ??? ? ???? ???? ?? ??? ? ????. ? ?? ?:

? ?? ?:

location.hostname? ? ???? ??? ??? ?????.

location.pathname? ?? ???? ??? ?? ??? ?????.

location.port? ? ???? ??(80 ?? 443)? ?????. ? ???

location.protocol? ??? ? ????(http:// ?? https://)? ?????.

Window Location Href

location.href ??? ?? ???? URL? ?????.

Instance

(?? ????) ?? URL? ?????.

<script>
document.write(location.href);
</script>

? ??? ??? ??? ????.

http://php.cn/js/js-window-location.html

Window Location Pathname

location.pathname ??? URL? ?? ??? ?????.

Instance

?? URL? ?? ??? ?????.

<script>
document.write(location.pathname);
</script>

? ??? ??? ??? ????.

/js/js-window-location.html

Window Location Assign

location.asse() ???? ? ??? ?????.


???? ??
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> </head> <head> <script> function newDoc(){ window.location.assign("http://www.ask.php.cn") } </script> </head> <body> <input type="button" value="加載新文檔" onclick="newDoc()"> </body> </html>