Web Page is getting hanged while loading

Posted by Thyagi under jQuery on 3/10/2014 | Points: 10 | Views : 517 | Status : [Member] | Replies : 1
Hi All,

I have a web page.On load of the page, i am performing 4 ajax calls for the service through JQuery .All are asynchronous calls.

The time taken varies for different browser .

Services Chrome FireFox
1 536?ms 1229ms
2 834?m 2300ms
3 971?ms 2800ms
4 10006?ms 3000ms
All the four Ajax calls mentioned above have js code dependent The result fetched from the data are used for binding the values to controls.

Please let me know how can i improve the performance of the page


function ReconcileContracts() {
$.ajax({
type: "GET",
url: '/' + ResolveUrl("/services/Contract/CompanyContractMetadata") + '?ContentID=' + PageSettings.ContentID,
async: "false",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
if (result != undefined && result != 'undefined' && result.length > 0) {
if (result === "All") {
$('._checkAllContracts :checkbox').prop('checked', true);
$('#contractSelector').hide();
}
else {
var ready = false;
while (!ready) {
if (totalContracts >= $("#contractsLeft option").length) {
SetSelectedContracts(result);
ready = true;
}
}
}
}
}
});
}




Responses

Posted by: Fundaclear on: 3/29/2014 [Member] Starter | Points: 25

Up
0
Down
just minify the css and js files and this problem will be solved.

Get Solutions To Your Problem Anywhere and Everywhere.

Thyagi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response