This question already has an answer here:
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);
</div>
You can try to next script:
$.ajax({
type: "GET",
url: "myPhpFile.php",
data: { firstargument: myArray, secondargument: myInteger }
})
.done(function(result){
console.log(result);
});