嗨,您如何使用 jQuery 在 html 中插入名称变量的值(在数据对象内)?
你能用jQuery实现这个吗?我的代码:
data = { // data object
action: 'addMember',
managerPassword: App.manager,
name: $('#name_add').attr('value'),
email: $('#email_add').attr('value')
};
$.ajax({
url: App.URL_manager,
data: data,
dataType: 'json',
type: 'POST',
success: function(r) {
if (r.success) {
$('.add_staff').fadeOut(1000, function() {
$('.success').find('#name').([INSERT VARIABLE HERE]);
$('.success').fadeIn(1000);
})
}
else {
alert('you looser');
}
}
});