JS 轉跳頁面 method - TerryLee7788/JS_test GitHub Wiki

頁面跳轉 可以用以下幾種方法直接修改window.location的值:

 window.location="http://example.com"; 
 window.location.href="http://example.com"; 
 location="http://example.com"; 
 location.href="http://example.com"; 

或是使用window.location所提供的function來跳轉:

  window.location.assign("http://example.com"); 
  window.location.replace("http://example.com");