我在下面使用这个脚本,并且在chrome和firefox上完美运行,但是就是说,我无法从webservice获得响应。如果成功或错误,我需要打开/重定向到其他网站!为什么可以在IE上读取webservice的响应,以及如何解决这个问题?
function sendInfo(userId, Code) {
// text with all info to send to controller
var values = {
"token": Code,
"code": userId
}
// POST THE CHANGE HERE TO THE DATABASE
var url = "WSFacebook.asmx/saveToken";
$.post(url, values, function(data) {
if (window.ActiveXObject) {
return data.xml;
}
var xmlString = new XMLSerializer().serializeToString(data);
var xml = xmlString,
xmlDoc = $.parseXML(xml),
$xml = $(xmlDoc),
$title = $xml.find("string");
var texto = $title.text();
if ($title.text() == "Success") {
window.location = '<%=ConfigurationManager.AppSettings["successUrl"].ToString() %>';
} else {
window.location = '<%=ConfigurationManager.AppSettings["errorUrl"].ToString() %>';
}
});
}