$(document).ready(function () { $.ajax({ url: "ajax.aspx", success: function (cout) { var CountArray = new Array; CountArray = cout.split(','); var GetAllSchoolBaseCourse_Count = CountArray[0]; var AllCourse = CountArray[1]; if (GetAllSchoolBaseCourse_Count == 0) { $("#SchoolBase").css("display", "none"); } if (AllCourse == 0) { $("#AllCourse").css("display", "none"); } } }); });