【发布时间】:2013-10-01 06:31:09
【问题描述】:
我正在调用登录网络服务。但我无法检查我将从服务器获得什么。我喜欢这样吗? 这是我的网址和参数
这是我的尝试 http://jsfiddle.net/LsKbJ/2/
$(document).ready(function () {
//event handler for submit button
$("#btnSubmit").click(function () {
//collect userName and password entered by users
var userName = $("#username").val();
var password = $("#password").val();
//call the authenticate function
authenticate(userName, password);
});
});
//authenticate function to make ajax call
function authenticate(userName, password) {
$.ajax
({
type: "POST",
//the url where you want to sent the userName and password to
url: "http://ii.c-cc.de/pp/REST",
dataType: 'json',
async: false,
crossDomain: true,
//json object to sent to the authentication url
data: {Username: userName, Password: password},
success: function () {
//do any process for successful authentication here
}
})
}
【问题讨论】:
-
您的端点为 POST 请求返回 404。
-
尝试使用 ,error:function(data){alert(data)}
-
yes ...这意味着找不到服务器。但是服务器正在运行..
-
您使用的网址是否正确? (我的意思是“CentronService/REST”部分)
-
是的,我的朋友给出了这个网址
标签: jquery json wcf web-services