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