ajax call with phonegap and laravel pages

I am working on phonegap and I’m new to this environment.

I have a login page which consists of username and password (normal login form).

On button click I am calling ajax code which is given below, but every time when I enter values it show me the error part of ajax, but I dont know why.

If i change the url value with any other then it starts normal working. My url page is made in Laravel 4. Could this be the reason the code does not work?

var name  = $('#username').val();
   type : 'POST',
   url : 'http://dummy-223-44.compute.amazonaws.com/login',
   data : {str : name},
   success : function(data) {
      alert("printing data"+data.response);
   error: function(xhr, status, e) {
        alert('xhr:- ' + xhr[0]+'-status-  '+status+'-eroror'+e.message);
return false;

Source: forms

Leave a Reply