<script type="text/javascript" src="/aaa/js/jquery-1.10.2.js"></script>
<script>
$(document).ready(function(){
$("#deltest").click(function(){
var r=document.getElementsByName("key");
var aa='';
for(var i=0;i<r.length;i++){
if(r[i].checked){
aa += r[i].value+",";
}
};
if(!aa){
alert("请选择需要删除的数据!");return false;
}
if (confirm('确实要永久删除选择项吗?')){
var taskid =42;
var user = {
};
$.ajax({
url:"/aaa/task/TaskDelAction.action",
data:{"delarray":aa,"taskid":taskid},
type:'post',
dataType:'text',
contentType:'application/x-www-form-urlencoded; charset=utf-8',
success:function(msg){
if(msg==1){
alert('删除成功!');
window.location.href = window.location.href;
}else{
alert('删除失败!');
}
}
});
}
});
});
</script>
ajax 删除数据, 返回 成功, 刷新页面
最新推荐文章于 2024-06-27 19:54:40 发布