<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("該資料被關聯,無法刪除! 🎜>}); <BR>} <BR>} <BR>先看式如何呼叫<BR>//刪除<BR>function DeleteOnclick() { <BR>DeleteData('SysMenu_List.aspx', Menu_Id) <BR>} <BR></script> <br><br> </div>