<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # JavaScript Window Location window.location 對象用于獲得當前頁面的地址 (URL),并把瀏覽器重定向到新的頁面。 ## Window Location _window.location_ 對象在編寫時可不使用 window 這個前綴。 一些例子: * location.hostname 返回 web 主機的域名 * location.pathname 返回當前頁面的路徑和文件名 * location.port 返回 web 主機的端口 (80 或 443) * location.protocol 返回所使用的 web 協議(http:// 或 https://) ## Window Location Href location.href 屬性返回當前頁面的 URL。 ### 實例 返回(當前頁面的)整個 URL: ``` <script> document.write(`location.href`); </script> ``` 以上代碼輸出為: ``` <script>document.write(location.href);</script>http://www.w3school.com.cn/js/js_window_location.asp ``` ## Window Location Pathname location.pathname 屬性返回 URL 的路徑名。 ### 實例 返回當前 URL 的路徑名: ``` <script> document.write(`location.pathname`); </script> ``` 以上代碼輸出為: ``` <script>document.write(location.pathname);</script>/js/js_window_location.asp ``` ## Window Location Assign location.assign() 方法加載新的文檔。 ### 實例 加載一個新的文檔: ``` <html> <head> <script> function newDoc() { `window.location.assign("http://www.w3school.com.cn")` } </script> </head> <body> <input type="button" value="加載新文檔" onclick="newDoc()"> </body> </html> ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看