私はIEで動作し、他のブラウザでは動作しない機能を持っていますクロスブラウザの互換性のために書き直すのを手伝ってください
function Fetch(xml) {
var Xml = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">";
Xml += GenerateAuthenticationHeader();
Xml += "<soap:Body>";
Xml += "<Fetch xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">";
Xml += "<fetchXml>";
Xml += CrmEncodeDecode.CrmXmlEncode(xml); // Microsoft _HtmlEncode function
Xml += "</fetchXml>";
Xml += "</Fetch>";
Xml += "</soap:Body>";
Xml += "</soap:Envelope>";
// Microsot CreateXmlHttp function
if ( XMLHttpRequest != null){
var XmlHttp = new XMLHttpRequest();
}
else{
var XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
XmlHttp.open("POST", "/mscrmservices/2007/crmservice.asmx", false); //Sync Request
XmlHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
XmlHttp.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/Fetch");
XmlHttp.send(Xml);
var ie = (window.ActiveXObject) ? true : false;
var XmlDoc = (ie) ? new ActiveXObject("MSXML2.DOMDocument") : new window.XMLHttpRequest();
XmlDoc.async = false;
XmlDoc.resolveExternals = false;
XmlDoc.loadXML(XmlHttp.responseXML.text);
return XmlDoc;
}
Google Chrome で動作するようにコードを変更する方法