Mootools: How to stop browser from freezing when Request is sent

452 Views Asked by At

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 Request takes place?

1

There are 1 best solutions below

2
On

your request is synchronous, so the browser will freeze until the request completes.

set async: true to resolve this