Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 506733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:43:54+00:00 2026-05-13T06:43:54+00:00

the problem is whenever I use $.get, $.post or $.ajax, I can’t find a

  • 0

the problem is whenever I use $.get, $.post or $.ajax, I can’t find a way to trigger a callback when the server is processing something. I can do it with the ajaxform plugin via the beforeSubmit method, but with the formerly mentioned functions, I can’t find a way to do it. $.ajax has a beforeSend method, but according to the documentation all it does is call a “callback to modify the headers”. I want a callback to do something like block the page, show a popup, display an animated gif etc.

Is there a way to show that the server is processing a request via the $.ajax, $.get, $.post, $()load?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:43:54+00:00Added an answer on May 13, 2026 at 6:43 am

    I already showed you in another question of yours how you can use ajaxStart for this.

    Here I will suggest yet another method to do this

    $('.be-delete').live('click', function(e) {
        e.preventDefault();
        var object =$(this);
        // if request hasn't finished after 250ms show spinner
        // if request is fast the timer is canceled in success/error
        var timer = setTimeout(function() {
            //I use append here (instead of html()) which doesn't destroy original content
            //now you only need to use CSS img.spinner { ... } to position the spinner correctly
            object.parent().append('<img class="spinner" src="media/images/jquery/spinner.gif"/>');
        }, 250);
        var url = object.attr('href');
        $.ajax({
            url : url,
            error : function(){
                clearTimeout(timer);
                object.find("img#spinner").remove();
                alert('An error has occurred, no updates were made');
            },
            success : function() {
                clearTimeout(timer);
                object.parent().fadeOut('slow', function(){object.parent().remove()});
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running into a problem that I can't seem to get past. Whenever I
I have a problem with using the prefix, seems like whenever I use the
I am using hg version 1.9.1. Problem is whenever I use hg update, I
Is it possible to create and attach a callback which would get called whenever
Whenever I use the keyboard in the iOS Simulator, I get about a 5
I´m having a problem whenever i try to use WMI services on a virtual
Whenever I use pear, I get this strange warning message: $ pear list PHP
I have the following problem: I use taxonomys (tx) as tags. They can be
I've been working on an Entity, oneToMany relationship, the problem is that whenever I
problem is , that whenever the grid's row is right clicked the selected item

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.