I have an asynchronous problem and for solve it I think I must use a callback. I want to execute some code after the code that is inside of the click()
function finishes. How can I do that?
$("#mybutton").click(function() {
$.ajax({
type: 'GET',
data: {
accion: "get_option_child",
id: id
},
url: 'webservices.php',
success: function(data) {
var json = JSON.parse(data);
// some code
}
});
});
Just add a call to your desired function at the end of the
success
handler for ajax: