关于在页面跳转前alert()不能弹出消息的问题

按照正常的逻辑,先显示消息,再将页面跳转,实际上不新alert对话框不能显示

Response.Write("<script>alert('dsafasdf');</script>");
Response.Redirect("webform2.aspx");

通过修改有两种解决方法一种:利用脚步跳转

Response.Write("<script>alert('dsafasdf');</script>");

Response.Write("<script>window.location.href='webform2.aspx'</script>");

 

第二种:还是利用脚本跳转

 

Response.Write("<script>alert('dsafasdf');top.location.href='webform2.aspx'</script>");

posted @   凡的世界  阅读(1227)  评论(0)    收藏  举报
< 2008年8月 >
27 28 29 30 31 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31 1 2 3 4 5 6
点击右上角即可分享
微信分享提示