2 Replies Latest reply on Jan 16, 2017 9:05 AM by kerrishotts

    when giving ip address in ajax url it gives status 0 error

    sethup51656429 Level 1

      friends can you please help me to correct my mistake?

      my Jquery code is this,

       

      $.ajax({

        url: 'http://192.168.1.14/phonegapserver/kharoofi/views/orderplacement.php',

          type: 'post',

        data:dataString,

          dataType: 'jsonp',

          success: function(result){

              alert(result);

          },

          error: function(result){

              alert(result+" error");

          }

        });

      another one that i tried,

      $.ajax({

        url: 'http://192.168.1.14/phonegapserver/kharoofi/views/orderplacement.php',

          type: 'post',

        data:dataString,

          success: function(result){

              alert(result);

          },

          error: function(result){

              alert(result+" error");

          }

        });

       

      also i tried javascript code as follow

       

      var xhttp = new XMLHttpRequest();

        xhttp.onreadystatechange = function() {

          if (this.readyState == 4 && this.status == 200) {

            alert( this.responseText);

          }alert( this.status);

        document.getElementById("result").innerHTML= this.responseText;

        };

        xhttp.open("post", "http://192.168.1.14/phonegapserver/kharoofi/views/orderplacement.php", true);

        xhttp.send();

       

      I used this code to send values from my phonegap application to php server...

      the alert box gives me '0' or 404 error