Alguien sabe a que se debe?
Les dejo el trozo de código que estoy usando en mi pa´gina:
Código:
function init() { ajaxFunction('http://myOtherDomain/MyService.ashx', "", OnOK, OnKO); } function OnOK() { alert("Ok"); } function OnKO() { alert("Ko"); } function ajaxFunction(url, params, ret_fun_ok, ret_fun_nook) { var xmlHttp = createXMLHttp(); xmlHttp.open("POST", url, true); //Send the proper header information along with the request xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(params); xmlHttp.onreadystatechange = function ext2() { if (xmlHttp.readyState == 4) { alert("xmlHttp.status = " + xmlHttp.status); if (xmlHttp.status == 200) { ret_fun_ok(xmlHttp.responseText); } else { ret_fun_nook(); } } }; } function createXMLHttp() { if (typeof XMLHttpRequest != 'undefined') return new XMLHttpRequest(); else if (window.ActiveXObject) { var avers = ["Microsoft.XmlHttp", "MSXML2.XmlHttp", "MSXML2.XmlHttp.3.0", "MSXML2.XmlHttp.4.0", "MSXML2.XmlHttp.5.0"]; for (var i = avers.length - 1; i >= 0; i--) { try { httpObj = new ActiveXObject(avers[i]); return httpObj; } catch (e) { } } } throw new Error('XMLHttp (AJAX) not supported'); }