码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2015-10-23 08:58:04      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:

如果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";

 

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

标签:

原文地址:http://www.cnblogs.com/lunawzh/p/4903357.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!