我有一個jQuery Ajax函數,它正在使用ASP.NET xml Web服務,如下面的代碼所示。使用jQuery/ajax的ASP.NET Web服務
代碼成功達到某一點(即「DoSomething」完成它應該做的事情),但似乎沒有進入「成功」功能(即警報沒有顯示)。
爲什麼?
$.ajax({
type: "POST",
url: "http://myServer/Service1.asmx/DoSomething",
data: "FirstName=AN&Surname=Other&[email protected]",
dataType: "text",
success: function (data) {
alert("test");
}
});
檢查控制檯錯誤。 – tymeJV 2014-10-16 13:46:57
嘗試添加'錯誤:功能()...',看看你得到什麼錯誤 – christiandev 2014-10-16 13:47:37
跨域問題?另外,我相信你的dataType應該是xml – mrpotocnik 2014-10-16 13:49:09