<script>
jQuery(document).ready(function(){
$("#delete_file").on("click",function(){
$("input:checkbox[name=file_cheak_name]:checked").each(function(i){//获取选中checkbox并依次执行
delete_file($(this).val());
});
});
});
function delete_file(key){
var bucket = "hos_8657b14e019b4d51af8fb7aadf5c751d";
$.ajax({
url : "hos/v1/object?bucket="+bucket+"&key="+key , // 处理的请求路径
type : "delete" , // 此处发送的是PUT请求(可变更为其他需要的请求)
// dataType : "json" , // 返回的数据类型为json类型
crossDomain:true, //设置跨域为true
xhrFields:{withCredentials:true},
success:function(data) {
if(data){
alert("操作成功");
window.location.href="yy-database.html";
}else{
alert("操作失败");
}
},
error:function(data) {
alert("操作失败");
}
});
return false;
}
</script>