Hi,
I'm very new to Drupal JSON web service and JQuery.
I have a JSON Web Service (http://www.myweb.com/services/json) and which has method called user.login.
The method user.login takes 2 params, username and password.
I tried to access the method using CURL commend
curl --data method="user.login" --data username="uname" password="DE"
http://www.myweb.com/services/json
It Works Fine.
Now, I want to access this method using jQuery.
I tried using jQuery Ajax Methods,
$.post("http://www.myweb.com/services/json",
'method=user.login&username=uname&password=de',
function(data){
alert(data);
});
and
$.ajax({
url: "http://www.myweb.com/services/json",
type: 'POST',
data:'method=user.login&username=uname&password=de',
contentType: 'application/json',
success: function(data,textStatus, jqXHR){
alert(data + " " + textStatus + " " +jqXHR);
}});
But success callback method not getting call. What is the problem with this code ? and How can I call user.login method using jQuery?
Can someone help me ?, plz
Thanks