Mohammad Raha Mohammad Raha - 7 months ago 29
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.


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");