mardi 4 août 2015

Internet explorer hanging with long running AJAX WebMethod on SetTimeout

I have a couple of SetTimeouts for when the page loads which will load in chart data using AJAX calls to the code behind.

    $(document).ready(function() {
        window.setTimeout(drawGraphs, 0);
        window.setTimeout(drawGraphsCharts, 0);
    });

This works great in Chrome and Firefox, however if one of the methods takes a long time, e.g. 1-5 seconds to finish, Internet Explorer hangs when this is taking place until this has completed, rather than loading one by one like the other browsers.

Has anyone come across this and how to fix it.

I am simulating a long running method at the moment using the following in my web method.

    for (var i = 0; i < 1000000000; i++)
    {
        var test = i + i;
        var test2 = i * i;
    }

Aucun commentaire:

Enregistrer un commentaire