how to deal with async calls in Ajax 4.0(using jquery?)
- by dexter
in my code i have done something like this.
$.get('/Home/Module/Submit',
{ moduleName: ModName,
moduleParameters: moduleParameters
},
function(result) {
$("#" + target).html(result);
});
when i put alert in the function(result) {..}
it shows html perfectly(both in alert and at the 'target'-on the .aspx page)
BUT when i remove the alert.. on the page the 'html' don't appear or appear randomly (this method is called multiple times)
i think that the 'result' comes to function asynchronously thats why it is not bind with the respective 'div'
however in the last iteration it gets bind every time.
can we make process stop until data gets bind?
or is there any functionality (like alert) which can make data bind..
without disturbing UI (unlike alert)?