用jQuery打開網頁的方法

用jQuery可以打開我們想要指定的網頁,或是跳轉到某某頁面,這時候可以用以下的語法實現

 

window.location.href = “//jetalk.com“;

window.location.replace(“//jetalk.com“);

或使用jQuery的屬性替換

$(window).attr('location','//jetalk.com');
$(location).attr('href', '//jetalk.com');