Here is some code I\'d like to execute. I\'d like to wait for AJAX response so I can return something from the server. Any way to achieve this?
function func
There is no need to wait for an Ajax-response. You can load your data in the head-section of your application:
function functABC(){
$.ajax({
url: 'myPage.php',
data: {id: id},
success: function(data) {
sessionStorage.setItem('mydata', data);
}
});
}
Then when the window.load event has fired, your data will be available:
alert(sessionStorage.getItem('mydata'));