我從託管在同一個CRM實例
此代碼在IE,但不以webresource作出FetchXML請求CRM Chrome瀏覽器...爲什麼呢?
$.ajax({
type: "POST",
dataType: 'xml',
contentType: "text/xml; charset=utf-8",
processData: false,
url: path,
data: fetchRequest,
beforeSend: function(xhr) {
xhr.setRequestHeader(
"SOAPAction",
"http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute"
); //without the SOAPAction header, CRM will return a 500 error
}
}).done(
function(data){
$(data).find("a\\:Entity").each(function() {
// loop entered in IE but not in chrome
}
}
);
編輯
的問題是不是與Ajax調用的問題是與.find()沒有得到從返回的XML節點。
所以要清楚,我得到什麼樣子相同的XML在每個瀏覽器的請求,但這裏find方法
$(data).find('a\\Entity')
回報鉻沒有項背...它完美的IE瀏覽器。
錯誤檢查控制檯(按f12) – Musa
沒有錯誤 – Peter