0

Is there another way to get a function from another page, that contains a variable being passed? My code:

    function getvoucher(id){

$.get("http://inactive/test.php?id=" + id, function(data, status){
return data;
});
}

However, the console tells me that my get method is wrong, is there another way I could do this? I receive what is in the page is just does not display, all I get is a blank page.

jasmine825
  • 144
  • 2
  • 15

1 Answers1

0

better you make your ajax request with .done event

   var url="http://inactive/test.php?id=" + id;
   $.get( url)
      .done(function( data ) {
        alert( "Data Loaded: " + data );
   });
Özgür Ersil
  • 6,909
  • 3
  • 19
  • 29