我知道這個問題已經被問了很多次了,從我對這個錯誤的研究中可以看出它發生是因爲跨域ajax只是允許使用JSONP,而不是XML。但是,我很難找到這個電話正在進行的地方,所以我無法準確找到問題所在。一切工作正常,直到我添加以下代碼XML解析錯誤:找不到元素位置:moz-nullprincipal(與ajax不兼容)
@EventListener(targets="licensingStatus", events="onchange")
public void onLicenseStatusChange(IRequestCycle cycle){
cycle.getResponseBuilder().updateComponent("licenceAuthRequiredDiv");
}
這是上面的代碼更新
<div jwcid="[email protected]">
<span jwcid="@If" condition="ognl:company.licensingStatus == @[email protected] && inApprovalMode()" renderTag="literal:false">
<input jwcid="[email protected]" disabled="ognl:disabled || isLicensingApprovalDateDisabled()"
value="ognl:company.licensingApprovalDate" displayName="message:company.licensingApprovalDate" validators="validators:maxDateToday,required" />
</span>
<span jwcid="@Else" renderTag="literal:false">
<input jwcid="[email protected]" disabled="ognl:disabled || isLicensingApprovalDateDisabled()"
value="ognl:company.licensingApprovalDate" displayName="message:company.licensingApprovalDate" validators="validators:maxDateToday" />
</span>
</div>
用Firebug的成分,當這是命中和移動通過和POST和GET請求我得到了以下的POST:302 Moved Temporarily
和GET請求只是掛起以下內容:XML Parsing Error: no element found Location: moz-nullprincipal:{a752d6c1-8e61-4faf-9084-97124f7b3596} Line Number 1, Column 1:
我知道這是沒有太多的工作,所以如果你需要了解任何信息只是問,但任何人都可以閃耀一些爲我點亮這個?
yup!這是我的情況,謝謝.. –
在我的情況下,響應頭顯示「text/xml」,但應該是「image/svg + xml」,apache AddType image/svg + xml svg爲我解決了它。謝謝 –