خرید بک لینک

Vote count: 0

I have following code to show a loading panel after e.g. clicking a button and making an Ajax call:

    $(document).on("click", function (e) {
        window.LoadingPanel.Show();
    });

After the Ajax call following code makes sure the loading panel disappears again:

    $(document).ajaxComplete(function() {
        if (window.LoadingPanel != null) {
            window.LoadingPanel.Hide();
        }
    });

But in some cases I redirect to another page depending on the result of the Ajax call by setting the window.location.href. In this case I want the ajaxComplete function NOT to hide the loading panel until the redirect has been succeeded.

How can I check in the ajaxComplete function if the window.location.href has been changed and the page is about to redirect?

asked 1 min ago

برچسب: javascript check if undefined,javascript check if array,javascript check if number,javascript check if object is empty,javascript check if array is empty,javascript check if string,javascript check if string contains,javascript check if array contains value,javascript check if variable exists,javascript check if object, نویسنده: استخدام کار تاريخ: چهارشنبه 14 مهر 1395 ساعت: 17:10

صفحه بندی