关于Alert的一个奇怪现象

ayjg 2003-10-17 09:41:00
代码如下:

......
10 <body>
11 <%
12 StrRight=session("right")
13 if StrRight="" then
14 alert("帐号过期,重新登录!")
15 window.location.href="login.asp"
16 end if
17 %>
18 </body>
......

当条件成立时,没有弹出对话框,同时还报错:缺少对象''行15
...全文
52 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wolf004 2003-10-17
  • 打赏
  • 举报
回复
10 <body>
11 <%
12 StrRight=session("right")
13 if StrRight="" then%>
<script>
14 alert("帐号过期,重新登录!")
15 window.location.replace('login.asp')
</script>

16 <%end if
17 %>
18 </body>
......
ayjg 2003-10-17
  • 打赏
  • 举报
回复
flyingghost(游魂) ,这个方法我已经试过了。在提出问题前我看过论坛里面的有关贴子,但都不凑效,郁闷!还有没有更好的方法?
oyoes 2003-10-17
  • 打赏
  • 举报
回复
response.write("<Script>alert(""帐号过期,重新登陆!"")</Script>")
flyingghost 2003-10-17
  • 打赏
  • 举报
回复

......
10 <body>
11 <%
12 StrRight=session("right")
13 if StrRight="" then
13 response.write "<script>alert('帐号过期,重新登录!');window.location.href='login.asp';</script>"
16 end if
17 %>
18 </body>
......
ayjg 2003-10-17
  • 打赏
  • 举报
回复
兄弟啊,你可以找本书看看,alert和confirm完全可以用在VBScript里面.
lp1983 2003-10-17
  • 打赏
  • 举报
回复
alert是javascript里的,怎么能这么用呢,这里你可以使用msgbox,不过服务器端一般都不使用的

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧