javascript - Error : no response while calling php web service from java script -


i have script me calls php webservice

$(document).ready(function(){

        });         function sendpushnotification(id){             var data = $('form#'+id).serialize();             $('form#'+id).unbind('submit');                             $.ajax({                 url: "send_push_notification_message.php",                 type: 'get',                 regid: data,               message: data,                 beforesend: function() {                  },                 success: function(data, textstatus, xhr) {                       $('.push_message').val("");                 },                 error: function(xhr, textstatus, errorthrown) {                  }             });             return false;         }     </script> 

sendpushnotification function:

<?php  require_once('loader.php');      $gcmregid    = $_get["regid"]; // gcm registration id got device     $pushmessage = stripunwantedhtmlescape($_get["message"]);       if (isset($gcmregid) && isset($pushmessage)) {           $registatoin_ids = array($gcmregid);         $message = array("price" => $pushmessage);          $result = send_push_notification($registatoin_ids, $message);          echo $result;     } ?> 

i trying pass values through php page when try pass values through web page , nothing happens.. can tell me problem here ? appreciated. thanks.

change this:

regid: data, 

to this:

data: data, 

or this:

data: {regid : data}, 

regid not available in jquery ajax.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -