开发者

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

开发者 https://www.devze.com 2023-02-09 00:53 出处:网络
i am developing an application. On a form submit i am sending a request to server using Request class in mootools.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消