0
I have the following code:
$('#aprovados').click( function(){
var job = $.getJSON($(this).attr("data-ajax-info-job"),
function(jobinfo){
return jobinfo }
);
console.log(job)
});
The idea was to return my json data that comes from my backend but I receive as if it were a log of the request. How could I change this code to only receive the json I need?
getJSON is asynchronous, so the.log(job) console will not wait for Ajax to return.
– Sam
That is, you will need to work with the data inside the getJSON function
– Sam
I understood but there was some way I could get that amount?
– Jhonatan Teodoro
with $.ajax is possible using async, but is not recommended :/
– Sam