目前遇到这个问题,我有ajax请求发送表单数据并将其保存到数据库,保存后我然后使用load()函数刷新表中的列表,但加载后,加载的div内的按钮不起作用也用js。
阿贾克斯
var formData = new FormData(this);
$.ajax({
url: "/systemadmin/storemanagement/"+id,
method: "POST",
data:formData,
cache:false,
contentType: false,
processData: false,
success:function(data){
console.log(data)
$("#storeDatatable").load(location.href + " #storeDatatable");
$(".message-error").remove();
$(".message-success").remove();
$('#store-update-header').append('<div class="message-success">Update succesfully</div>');
}, error:function (err) {
if (err.status == 422) {
console.log(err.responseJSON);
$(".message-error").remove();
$(".message-success").remove();
$.each(err.responseJSON.errors, function (i, error) {
$('#store-update-header').append('<div class="message-error">'+error[0]+'</div>');
});
}
}
});
通过使用
解决
$(document).on('click','.toggleModal-updateStore', function(){ })
$('.toggleModal-updateStore.').on('click', function(){ })
GENIOOOOOOOOO 我已经解决了这个问题,但没有任何解决办法...最后我是 hubiera ocurrido 时代的 cambiar eso。乘坐巴士前往 asi 的功能