Mohammad Raha Mohammad Raha - 1 year ago 61
HTML Question

new idea to load page in full ajax pages

i have some problem with my site loading.
my site is a full ajax site so i need to a load page to show it when a button clicked or some thing like that. i create a

element with loading content and
it when buttons clicked and
it when proccess end. but in fact the
loading div
hide before the new content loaded.

I use
function to send and manage my requests to server.

how can i solve this problem ? help me if you have a good idea please.

Answer Source

Use below code that will be help you out.

$(document).ajaxStart(function () {
        $("#loaderdiv").css("display", "block");

    $(document).ajaxComplete(function () {
        $("#loaderdiv").css("display", "none");
    $(document).ajaxError(function () {
        $("#loaderdiv").css("display", "none");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download