I recover data from a Requette in ajax. I want to use this data in a function and return it but when I call the function it returns nothing
function getdata(nom_produit) {
$.ajax({
type: "POST",
url: "traitement/panne/test_panne.php",
data: {
nom_produit: nom_produit
},
success: function(data) {
var obj = jQuery.parseJSON(data);
jQuery.each(obj["resultat"], function(index, value) {
})
}
});
return obj;
}
how i can return the data?