【问题标题】:CLASSIC ASP QUERY经典的 ASP 查询
【发布时间】:2010-08-25 06:22:34
【问题描述】:
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 后,我无法申请任何其他休假,因为消息框正在显示。我只想在我申请休假类型 28 且状态级别为 p 时显示消息框。否则我不需要离开1或2的消息框。我该如何修改..? 谢谢

【问题讨论】:

    标签: asp-classic


    【解决方案1】:

    ASP 在服务器端执行,&lt;script&gt;.... 在客户端执行。

    你正在寻找的是(我认为)

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

    没有%&gt;&lt;%。因此编写 javascript 代码,使其出现在客户端 html 中。

    【讨论】:

    • 他肯定已经在 if 语句中加入了 只会在 if 评估为 true 时插入脚本标签。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-24
    • 1970-01-01
    相关资源
    最近更新 更多