问一个关于ASP的问题

来源:百度知道 编辑:UC知道 时间:2024/07/06 20:37:04
我想实现一个如下的例子:
点击页面中一个链接就马上弹出一个警告窗口(不会刷新网页),警告窗口有确定和取消两项。点击确定则转向页面A.ASP,点击取消则回到原index.asp.请问如何编写这些代码。

function firm()
{//利用对话框返回的值 (true 或者 false)
if(confirm("你确信要转去 a.asp?"))
{//如果是true ,那么就把页面转向thcjp.cnblogs.com
location.href="a.asp";
}
else
{//否则说明下了
location.href="index.asp";
}
}