我创建了一个jQuery的单击事件,以删除XML东西锉的代码如下:这段代码有什么问题?
$(".delete_engine").bind("click",function(){
var del = $(this);
var id = del.attr("id");
var c = confirm("You sure want to delete this?");
if(c)
{
/* $(this).next('.pclass').remove();
$(this).prev('.rurl').remove();
$(this).remove();*/
$.ajax({
type: "POST",
url: "http://localhost:8080/cPEP_UI/Engine_engine_delete",
data: "eid="+id,
dataType: "json",
success: function(data) {
$('#light').html("<img src='loading.gif' alt='loading gif'/>");
$('#light').css("display","block");
$('#fade').css("display","block");
if(data.update == "success"){
del.parent().next().remove();
del.parent().remove();
$('#light').html(data.message+" "+data.update);
}
},
error:function(xhr,err){
//alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status);
alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status);
$('.error').html("responseText: "+xhr.responseText);
}
});
}
});
但事实是,它不是谷歌浏览器的工作,但与Mozilla Firefox浏览器正常工作。任何想法为什么发生这种情况?!是因为缓存!?
什么是不工作?发生了什么不应该或者不应该发生的事情? – 2011-05-02 14:33:20
不要太挑剔,但你会介意让这个坏男孩回到左边缘一点吗? :) – pixelbobby 2011-05-02 14:35:30
什么没有发生:它不是从xml文件中删除特定项目,也没有显示和jquery ajax方法的错误消息。但在Mozilla中,它正确删除并显示#light id div。 – Maverick 2011-05-02 14:37:08