确认框返回false是否在服务器端工作?

时间:2017-08-09 03:17:42

标签: asp-classic return confirm

我检查了我的ASP服务器端,但是当我有以下代码时。我无法获得返回虚假工作?任何人都可以帮助我帮忙

if Ubound(arr) < 0 then
        response.write "<script language='javascript'>"
        response.write "if (confirm(""Emptying the selected box will delete the Holiday Calendar Code"")==0)"
        response.write " {return false;}"
        response.write "</script>"
    end if

1 个答案:

答案 0 :(得分:0)

要使确认框返回false,请尝试以下操作:

if Ubound(arr) < 0 then
        response.write "<script language='javascript'>"
        response.write "if ( ! confirm(""Emptying the selected box will delete the Holiday Calendar Code"") )"
        response.write " {return false;}"
        response.write "</script>"
    end if

但是,它不会停止任何页面加载。服务器端代码始终在任何客户端代码之前执行,因此添加确认框在此处无法正常工作。你到底想要完成什么?

结果: Still error on the return statements

相关问题