ajax 调用后,我得到包含整个 jsp 页面的响应。如何仅获取页面的一部分,或者当我使用 SWF 时,如何仅获取评估块的结果?我的 js 文件中有下一个 ajax 调用:
var url = $('#srcCurrencySpace').attr('resource');
$.ajax({
type : "POST",
url : url,
cache:false,
data: $('#form').serialize(),
dataType: "text",
success : function(response)
{
//Write you success logic here
var newHtml = $('#srcCurrencySpace', response).html();
$('#srcCurrencySpace').html(newHtml);
},
error : function(XMLHttpRequest, textStatus, errorThrown)
{
//Write you error-handling logic here
alert("error!");
}
});
这个请求转到:
<transition on="updateAmountSrcCurrency" validate="false">
<evaluate expression="retrieverFactory.getSrcCurrency(application)" result="flowScope.amountSrcCurrency"/>
<render fragments="srcCurrencySpace"></render>
</transition>
最后从我的jsp中摘录:
<span id="srcCurrencySpace" resource="${updateURL}">
<c:out value="${amountSrcCurrency}" default="LVL" />
</span>