1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| $(function () {
$("#callAjax").click(function () {
alert("CallAjax");
$.ajax({
type: "POSt",
url: "http://64.15.136.251:8080/onestatus/webservice/login",
data: "{email:'kk@kk.com',password:'123456'}",
contentType: "application/json; Characterset=utf-8",
dataType: "json",
async: true,
success:onSuccess
});
});
$("#resultLog").ajaxError(function (event, request, settings, exception) {
$("#resultLog").html("Error Calling: " + settings.url + "<br />HTPP Code: " + request.status);
});
function onSuccess(data) {
var arrayObject = new Array();
for (i = 0; i < data.user.length; i++) {
$('#employeeList').append('<li>' + data.user[i].response + '</li>');
$('#employeeList').append('<li>' + data.user[i].user_id + '</li>');
$('#employeeList').append('<li>' + data.user[i].session_id + '</li>');
}
}
}); |
Partager