调用此 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>