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>
相关推荐
LuAndy 2020-08-15
powrexly 2020-07-20
loviezhang 2020-06-16
songerxing 2020-01-04
wangyjbk 2019-12-27
itjavashuai 2019-12-15
zhaijunliang00 2019-11-24
zhihuijiao 2019-11-19
whutjiajiao 2019-09-08
waitzkj 2019-01-26
WoogeYu 2019-01-26
Ping 2019-07-01
shixiaoguo0 2017-05-09
heavstar 2019-06-30
Mrwind 2019-06-27
数据库之扑朔迷离 2019-06-26
xiaocaibai 2013-12-12
XaverSun 2013-11-15