比如jsp页面中有一个id,如何通过jquery的$.ajax()方法将这个id传给action中的user.id?主要是ajax({...})
展开全部
假如你的ID存放在这里 <input type="hidden" id="笑裤亮uID" value="XXX" />纯蔽
jQuery.ajax({
url: '你的action',
data:{uId:$("#uID"碰宽).val()},
complete: function(xhr, textStatus) {
//called when complete
},
success: function(data, textStatus, xhr) {
//called when successful
alert(data.name);
},
error: function(xhr, textStatus, errorThrown) {
//called when there is an error
}
});
jQuery.ajax({
url: '你的action',
data:{uId:$("#uID"碰宽).val()},
complete: function(xhr, textStatus) {
//called when complete
},
success: function(data, textStatus, xhr) {
//called when successful
alert(data.name);
},
error: function(xhr, textStatus, errorThrown) {
//called when there is an error
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询