AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > JavaScript

jQuery ajax中使用confirm,确认是否删除的简单实例

51自学网 http://www.wanshiok.com
jquery,ajax,confirm

jQuery ajax 中使用confirm ,确认是否删除按钮 onclick="return confirm('确认删除?');"

<script type="text/javascript">$(function(){   $("#btnDelete").click(function(){  //var user8ID = $.trim( $('#user8ID').val() );  var statu = confirm("Are you sure to delete the current data?");  if(!statu){   return false;  } var operation = '8IDdelete';  $.ajax({    type:'POST',    url:'backendUserModuleMapping.php?stamp='+new Date().getTime(),    data:'operation='+operation+'&'+$("form").eq(1).serialize(),    success:function(msg){      if(msg == 1){       alert( 'Delete Successful!' );       location.reload();      }else{       alert( 'Delete Failed!' );      }          },    error:function(){      alert( 'Delete Failed!' );    }       });   });  });</script>

以上就是小编为大家带来的jQuery ajax中使用confirm,确认是否删除的简单实例全部内容了,希望大家多多支持wanshiok.com~


jquery,ajax,confirm  
上一篇:JS中递归函数  下一篇:JavaScript简单实现弹出拖拽窗口(一)