1
調用此AJAX方法時,我不斷收到「error:undefined」消息。消費IIS託管WCF與JQuery AJAX
$.ajax({
type: "GET",
async: false,
url: "localhost/ServiceHost/Security.svc/GetAllUserErrors",
data: "{ }",
dataType: "json",
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },
success: function (data) {
for (var i = 0; i < data.d.length; i++) {
if (i % 2 == 0) rows += "<tr><td><input type=\"checkbox\"/></td>";
else rows += "<tr class=\"alternate-row\"><td><input type=\"checkbox\"/></td>";
rows += "<td>" + data.d.SyncTimeStamp.toString() + "</td>";
rows += "<td>" + data.d.Name.toString() + "</td>";
rows += "<td>" + data.d.Login.toString() + "</td>";
rows += "<td>" + data.d.NotificationText.toString() + "</td>";
rows += "<td class=\"options-width\"><a href=\"\" title=\"Edit\" class=\"icon-2 info-tooltip\"></a></td></tr>";
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus + ":" + errorThrown);
}
});
我知道WCF正在運行,但我無法弄清楚爲什麼我得到這個錯誤。任何幫助?
我確定問題出在'url'部分。這條線的正確語法是什麼?
<services>
<service name="Security.WCFServiceLibrary.Security">
<endpoint address="" binding="wsDualHttpBinding" bindingConfiguration=""
contract="Security.WCFServiceLibrary.ISecurity" />
</service>
</services>
'async:false' - 有誰知道一個好的驅魔人? :D – Andreas 2012-08-13 18:35:38
請發佈您的web.config的相關部分。 – schglurps 2012-08-13 18:38:58