-1

I have a php file that takes a array and an integer and returns a string. I would like to get that string, however, when I log the result to the console, I see an object and don't see my string anywhere inside

result = $.ajax({ url: 'myPhpFile.php?firstargument=myArray&secondargument=myInteger' });

console.log(result);
LemonMan
  • 2,963
  • 8
  • 24
  • 34

1 Answers1

1

You can try to next script:

$.ajax({
   type: "GET",
   url: "myPhpFile.php",
   data: { firstargument: myArray, secondargument: myInteger }
})
.done(function(result){
   console.log(result);
});
fortegente
  • 1,361
  • 2
  • 11
  • 22