Я звоню в веб-службу входа. Но я не могу проверить, что я получу от сервера. Мне это нравится? Вот мой URL и параметрКак вызвать wcf webservice json с помощью jquery?
Вот моя попытка 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
}
})
}
Ваша конечная точка возвращает 404 для запросов POST. – haim770
попробуйте, ошибка: функция (данные) {Alert (данные)} –
да ... Это значит, сервер не найден сервер .Но работает .. – user2648752