0 Replies Latest reply on Jul 22, 2016 5:54 AM by GreenGoneMad

    Phonegap Desktop: $.ajax POST returning “status”:403,“statusText”:“Forbidden”

    GreenGoneMad Level 1

      Hi there,

      I'm writing a mobile app that uses AJAX. I have never used AJAX before so to see how AJAX works, I wrote a simple app that talks to asp.net page.  The app is a simple form (one text field and submit button) in which you enter an year and click submit. Ajax call is made to results.aspx.cs page on the server which returns the result and displayed on 2nd page that is inside index.html.


      When I run this app on using Phonegap Desktop, I'm getting 403 (Forbidden)


      I have added   <access origin="http://mywebsite/" /> to config.xml file. The server side file that I'm trying to access is http://mywebsite/results.aspc.cx.


      Can someone give me a clue as what is wrong?


      Here is my code:



          var landmarkID = $(this).parent().attr('checkyear');

          var postData = $(this).serialize();



              type: 'POST',

              data: postData+ '&amp;txtYear=' + txtYear.value,

              url: 'http://mywebsite/results.aspx.cs/IsLeapYear',

              success: function(){


                  alert('Your comment was successfully added');


              error: function(){


                  alert('There was an error adding your comment');




          return false;