<div class="codetitle"> <span><a style="CURSOR: pointer" data="45342" class="copybut" id="copybut45342" onclick="doCopy('code45342')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code45342"> <br><script type="text/javascript"> <BR>/* 请求Ajax 带返回值,并弹出提示框提醒 <BR>--------------------------------------------------*/ <BR>function getAjax(url, parm, callBack) { <BR>$.ajax({ <BR>type: 'post', <BR>dataType: "text", <BR>url: url, <BR>data: parm, <BR>cache: false, <BR>async: false, <BR>success: function (msg) { <BR>callBack(msg); <BR>} <BR>}); <BR>} <BR>/*删除 <BR>/*url: 表示请求路径 <BR>--------------------------------------------------*/ <BR>function DeleteData(url, id) { <BR>var parm = 'active=Del&id=' + id; <BR>if (id == undefined || id == "") { <BR>showAlertMsg('请选择要删除一行'); <BR>} else { <BR>showConfirmMsg("此操作不可恢复,确定要删除吗?", function (r) { <BR>if (r) { <BR>getAjax(url, parm, function (rs) { <BR>if (parseInt(rs) > 0) { <BR>showOverAlertMsg("删除成功!", 2000, 4); <BR>} else if (parseInt(rs) == 0) { <BR>showOverAlertMsg("该数据被关联,无法删除!", 2000, 3); <BR>} <BR>else { <BR>showOverAlertMsg("删除失败!", 2000, 5); <BR>} <BR>}); <BR>} <BR>}); <BR>} <BR>} <BR>先看式如何调用 <BR>//删除 <BR>function DeleteOnclick() { <BR>DeleteData('SysMenu_List.aspx', Menu_Id); <BR>} <BR></script> <br> </div>