Java Script hangs IE

Sometime JavaScript(Ajax call) hangs some browser(specially IE) or browser stops responding. The reason behind it is the settings of the Ajax call.
If we are using ajax call then such problem may arise.

The partern of Ajax call in JQuery is like-

//Ajax call
    $.ajax({
        url: "the url here",
        global: false,
        type: "POST",
        data: ({param1 : paramVal}),
        dataType: "html",
        async:true,
        success: function(respMsg){
            
            alert(respMsg);
            
        }
    }).responseText;
//End of Ajax call

Here we must take care about the settings(A set of key/value pairs that configure the Ajax request).
The Ajax call may hangs the IE browser if we use the value of the setting “async” as false, it will freeze the browser until the server replies.

By default, all requests are sent asynchronously. As in JQuery API description says — “By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: “jsonp” requests do not support synchronous operation.

Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active.”

So if it is not required then set the “async” as true (as the name AJAX suggests) to avoid such problem.

Related Tags:
Java Script hangs IE, Query hangs IE, JQuery Ajax Call Hangs IE, JQuery hangs the browser, Ajax, AJAX call hangs the browser, JavaScript hangs the browser. JavaScript is too slow

150 150 Burnignorance | Where Minds Meet And Sparks Fly!