<address id="ttjl9"></address>

      <noframes id="ttjl9"><address id="ttjl9"><nobr id="ttjl9"></nobr></address>
      <form id="ttjl9"></form>
        <em id="ttjl9"><span id="ttjl9"></span></em>
        <address id="ttjl9"></address>

          <noframes id="ttjl9"><form id="ttjl9"></form>

          關于javascript跳轉與返回和刷新頁面

          2020-3-1    前端達人

          javascript中window.open()與window.location.href的區別

          window.open(‘index.html’) 表示新增一個窗口打開 index.html 這個頁面,并不刷新

          location.href(‘index.html’) 表示在當前窗口重定向到新頁面,打開并刷新 index.html 這個頁面



          window.location 是 window 對象的屬性,用來替換當前頁,也就是重新定位當前頁

          而window.open 是 window 對象的方法,是用來打開一個新窗口的函數



          // 打開新頁面
              // 注意:有些瀏覽器的安全設置會將window.open()屏蔽,例如避免彈出廣告窗
              window.open('./index.html');
          
              // 在原窗口打開新頁面
              window.location.href="./index.html";
          
          
              

          window.open()詳解

          window.open ('page.html', 'newwindow', 'height=100, width=400, 
          top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')
          
          
          
          參數解釋: 三個參數
           window.open 彈出新窗口的命令;
           ‘page.html’ 彈出窗口的文件名;
           ‘newPage’ 彈出窗口的名字(不是文件名),非必須,可用空’'代替;
           height=100 窗口高度;
           width=400 窗口寬度;
           top=0 窗口距離屏幕上方的象素值;
           left=0 窗口距離屏幕左側的象素值;
           toolbar=no 是否顯示工具欄,yes為顯示;
           menubar=no 是否顯示菜單欄,yes為顯示;
           scrollbars=no 是否顯示滾動欄,yes為顯示;
           resizable=no 是否允許改變窗口大小,yes為允許;
           location=no 是否顯示地址欄,yes為允許;
           status=no 是否顯示狀態欄內的信息(通常是文件已經打開),yes為允許;
          
          常用的js返回與刷新頁面
          在此用a標簽舉例
          
          
          
          
          
          

          日歷

          鏈接

          個人資料

          藍藍設計的小編 http://www.syprn.cn

          存檔

          亚洲va欧美va天堂v国产综合