私はajaxを使用してリクエストを送信するためのjqueryコードを持っています.しかし、成功した関数のキープレスが再び起動しない後、これは私のコードです
$(".id_sort").bind('keypress',function(e){
if (e.which == 13){
var index_fix = [];
var index_ori = [];
for (i=0;i < $("tbody tr").length; i++){
index_ori.push(i);
}
$(".id_sort").each(function(){
index_fix.push(Number($(this).val())-1);
});
if (JSON.stringify(index_fix) !== JSON.stringify(index_ori)){
data = { key : 'sort', index : JSON.stringify(index_fix)};
$.ajax({
url : "/ajax/",
data : data,
type : "POST",
cache : false,
success : function (resp){
$(".data").html(resp);
// what should i do here..keypress enter doesn't work in second time
}
});
}
else {
alert("data sama coy");
}
}
});