2010-08-25 78 views
1
do until rs1.eof    

elseif year(tDate) = year(now) then 

elseif rs1("leavetype") = 1 and (rs1("statusLev1") = "z" and rs1("statusLev2") = "z") then 
        childcare = childcare + rs1("totaldays") 

elseif rs1("leavetype") = 28 and (rs1("statusLev1") = "P" and rs1("statusLev2") = "P") then 
%> 
<script>alert("You are...") 
history.go(-1)</script> 
<%** 
    end if 

     end if 
    rs1.movenext 
    loop 
    rs1.movefirst 

提交leavetype = 28后,由于消息框是showing.I我不能申请任何其他假期要显示的消息框,只有当我申请休假28型和状态水平为p 。否则我不需要留言1或2的消息框。我可以如何修改..? 谢谢传统的ASP QUERY

回答

1

ASP在服务器端执行,<script>....在客户端站点上执行。

你所寻找的是(我认为)

Response.Write("<script>alert(""You are...""); history.go(-1)<script>") 

withgout的%><%。所以编写JavaScript代码,以便它出现在客户端的HTML。

+1

当然,他已经得到<%end if%>只会在if评估为true时插入脚本标记。 – Rob 2011-03-31 09:47:59