1.要想用json类型,可在Controller .xml用type="jsonjava"type="none"返回数据放于request中
$jq.ajax({
type:"POST",
url:"<@ofbizUrl>"+u+"</@ofbizUrl>?productId=" + id + "&status="+status,75); font-family:SimSun; font-size:10pt">dataType: "json",75); font-family:SimSun; font-size:10pt">success: function(data) {
$jq('#p_'+id).html("("+data.status+")");
}
});
2.不用json类型,ajax可以调用另一个ftl的screen,其效果相当于局部的submit
3.$.post的bug在jquery中自己的实现。
post: function( url,data,callback,type ) {
if ( jQuery.isFunction( data ) ) {
callback = data;
data = {};
}
return jQuery.ajax({
type: "POST",
url: url,75); font-family:SimSun; font-size:10pt"> data: data,75); font-family:SimSun; font-size:10pt"> success: callback,75); font-family:SimSun; font-size:10pt"> dataType: type
});
}
原文链接:https://www.f2er.com/ajax/162865.html