后台sql查询的数据,怎么通过ajax传到前台的input
$(function() {
$.ajax({
type : 'post',
url : 'xxx.action',
dataType : 'json',
data : {
'Id' : $('#Id').val()
},
success : function(data) {
if(data != null && data.length > 0){
}
},
error : function() {
$.message.alert('提示', '请求失败!', 'error');
}
});
});
if里面应该写些什么内容呢