jquery setTimeout()几秒钟后跳转网页

时间:2022-01-26 20:34:31

JS  停留几秒钟后跳转网页

<script type="text/javascript">  
$(document).ready(function () {
//$("#submitbtn").click(function(){
setTimeout(function(){//两秒后跳转
alert("恭喜你注册成功,两秒后跳转。");
//location.href = "index.php";//PC网页式跳转
$.mobile.changePage("index.php"); //手机网页式跳转
},2000);
// });

});


</script>