Hi. I'm relatively new to jquery. I was trying to do the authentication using JSON API's and if its a success it should start holding the session. If the JSON api doesn't retrieve any results, it should pop an alert showing "Not a User
Here is the script. I'm not sure what is missing.
Its able to display "success loop" message but not the error alert
- $.ajax
- ({
- type: 'GET',
- url: link,
- dataType: "jsonp",
- success: function (data)
- {
-
- $.session("sessionVariable",username);
- //alert($.session("sessionVariable"));
- alert("success loop");
-
- },
-
- error: function () {
- alert("not a user. Unable to login")
- }
-
- });