js alert()后进行跳转的方法

如果alert()之后再进行跳转本页,按以下方法你将等不到alert(),浏览器就本身刷新本页面了

<script type="text/javascript">
alert("你的资料已经录入!");
window.location.reload();
</script> 


想要弹出alert()后再跳转就用window.location.href="http://baidu.com"; ,改成下面方法 就OK了。

 alert("你的资料已经录入!");
 window.location.href = "http://baidu.com";
原文地址:https://www.cnblogs.com/lunawzh/p/4903357.html