日期:2014-05-17  浏览次数:21326 次

函数去js返回值再调用函数得问题,急
<%   response.write( " <td   class=ctd> <a   href= " "docbak_add.asp?s_lsh= "&rs( "lsh ")& " " "   onclick= " "rusure()   ; " "> 存盘 </a> </td> ")%>    
点击存盘这个连接,弹出对话框   问是否批量保存
function   rusure()
{var   ans   =   confirm( "是否批量存盘吗?\n确定:批量保存\n取消:单个保存 ")    
return   ans
}  
我想写个函数   得到function   rusure()的返回值,如果点击是确定   则执行批量保存函数   点击取消则执行单个保存函数        
批量保存和单个保存函数已写好   就差得到function   rusure()的返回值的函数
急!解决立马结帖

------解决方案--------------------
<script language= "javascript ">
var ans=false; //定义一个全局函数即可
function rusure()
{ans = confirm( "是否批量存盘吗?\n确定:批量保存\n取消:单个保存 ") ;
return ans;
}
rusure();
alert(ans);
</script>
------解决方案--------------------
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<title> Title </title>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 "/>
<meta name= "keyWords " content= "jymass.com,jymass "/>
<meta name= "description " content= "jymass.com,jymass "/>
<meta name= "author " content= "gradesystem@163.com "/>
<meta name= "robots " content= "index,follow "/>
<meta name= "copyright " content= "Copyright 2002-2006. www.chinateachsoft.net . All Rights Reserved. "/>
<link rel= "stylesheet " type= "text/css " href= " ">
<script language= "JavaScript " type= "text/javascript ">
<!--
function btn_click()
{
var sBlooean ;
sBlooean = confirm( "是否批量存盘吗?\n确定:批量保存\n取消:单个保存 ")
{
if (sBlooean)
{
this.location = "1.htm ";
}
else
{
this.location = "2.htm ";
}
}
}
//-->
</script>
</head>

<body>
<a href= "# " onclick= "btn_click() "> 存盘 </a>
</body>
</html>

------解决方案--------------------
直接用JS就可以完成呀