当我点击类.btn-edit
的按钮时,会出现模态,但是当我提交ajax
请求后,如果我点击模态按钮,则模态不会显示。我需要刷新页面才能再次使用。
$(".btn-edit").click(function(){
$('#edit-profile').modal('show');
});
$(".update-form").submit(function(s){
s.preventDefault();
var website_name = $('input[name=website_name]').val();
var website_url = $('input[name=website_url]').val();
var type = $('#type option:selected').val();
var category = $('#category option:selected').val();
var sells = $('input[name=sells]').val();
var location = $('input[name=location]').val();
var payment = $('input[name=payment]').val();
var description = $("textarea#message").val();
$('#edit-profile').modal('hide');
$.ajax({
type: "POST",
url: "advertiser/update",
data: {
_token: token,
website_name: website_name,
website_url: website_url,
type: type,
category: category,
sells: sells,
location: location,
payment: payment,
description: description
},
success: function(data) {
$('.wrapper').html(data);
}
,
error: function(data) {
}
});
});