0
我想在从我的猫中删除邮件时刷新div如何使其工作?
我已经放了一段代码。
预先感谢您。POST后刷新div
<script type="text/javascript">
function deleteBox(id){
if (confirm("Confirnez-vous la suppression du message?"))
{
var dataString = 'id='+ id;
$.ajax({
type: "POST",
url: "del.php",
data: dataString,
cache: false,
success: function(result){
if(result){
// if data delete successfully
if(result=='success'){
//Check random no, for animated type of effect
var randNum=Math.floor((Math.random()*100)+1);
if(randNum % 2==0){
// Delete with slide up effect
$("#chat-item_"+id).slideUp(1000);
// HERE
}else{
// Just hide data
$("#chat-item_"+id).hide(500);
}
}else{
var errorMessage=result.substring(position+2);
alert(errorMessage);
}
}
}
});
}
}
</script>
谢谢您的帮助
你的猫咪正在发送消息!切肉猫! – 2014-10-01 20:02:46
这是一个例子,你有一个想法? – Boom 2014-10-01 20:08:52
聪明*,聪明@Dagon。刷新div?这不是使用DOM操作的重点,所以你不必“刷新”任何东西? – proulxs 2014-10-01 20:11:25