How to return the function's value only after jquery .load() is finished? What I wanted to mean is something like this. Is there any possible way to do it without using ajax or server side scripts?
function initCalculate() {
var theFirstResult = getResultPage(1);
}
function getResultPage(value) {
var $tmpDiv = $('<div>');
var result = '';
$tmpDiv.load('result.html #' + value, function () {
result = $(this).html();
});
return result;
}