开发者

Why is my AJAX request hanging after running for a while?

开发者 https://www.devze.com 2022-12-24 04:25 出处:网络
My AJAX calls from a page I wrote is hanging after an indeterminate number of calls.The page makes a request after a preset amount of time (currently 5 seconds) gets data from my server then waits the

My AJAX calls from a page I wrote is hanging after an indeterminate number of calls. The page makes a request after a preset amount of time (currently 5 seconds) gets data from my server then waits the amount of time again. When I put the following as my AJAX Request:

myAjax = new Ajax.Request(
    url,
            {
                    method: 'get',
                    asynchronous: true,
                    url: url,
                    parameters: querystring,
                    onInteractive: document.getElementById('meh').innerHTML='Interactive',
                    onSuccess: processXML

            });

The div with the id "meh" will get the word Interactive written to it, but the Success condition never g开发者_高级运维ets executed (same if onSuccess is replaced with onComplete).

So why is my code doing this? Thanks.


Shouldn't the onInteractive event handler be a reference to a function?


as pb said, shouldn't it be

onInteractive: function(){
document.getElementById('meh').innerHTML='Interactive'
}
0

精彩评论

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

关注公众号