Mootools: How to stop browser from freezing when Request is sent
i am developing an application. On a form submit i am sending a request to server using Request class in mootools. but when i click on submit button it freezes browser, till the response comes from server.
The ResponseText is sent to a custom function responseProcessor() for processing on it.The Request Object is like:
req = new Request({
async: true, method: 'post',
onSuccess: function(html) { responseProcessor(); },
onFailure: function() { alert('Page Loading Failed ....!!'); },
});
req.send({url: "js/jsCode.php"});
I cant figure out why browser is freezing while Reque开发者_如何学Gost takes place?
your request is synchronous, so the browser will freeze until the request completes.
set async: true to resolve this
精彩评论