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

  • Home
  • SEARCH
  • 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 6898663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:19:31+00:00 2026-05-27T07:19:31+00:00

I red some articles and similar questions on stack overflow but didnt really find

  • 0

I red some articles and similar questions on stack overflow but didnt really find any simple clean solution to this problem.

for example this is my ajax function:

  $.ajax({
            url: "/Home/AddSong",
            type: "POST",
            data: $("#AddTopTenFavForm").serialize(),
            success: function (data) { ShowMsg("Song Added Successfully"), $(container).find('ul').append('<li><a class="savedLinks" href="#" name="' + substr + '" >' + name + '</a> <span name= ' + data +' class="btnDeleteSong dontDoAnything">x</span></li>'); },
            error: function () { ShowMsg("There was an error therefore song could not be added, please try again") }
        });

I would like to call my functions:

 function ShowAjaxLoader() {
$("#dottedWrapper").fadeIn();
$("#loadingGifContainer").fadeIn();
}

 function HideAjaxLoader() {
$("#dottedWrapper").fadeOut(1000);
$("#loadingGifContainer").fadeOut(1000);
}

when Ajax request starts and when it finishes. Please help thanks

  • 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-27T07:19:31+00:00Added an answer on May 27, 2026 at 7:19 am

    Call the show function before the ajax, then call the Hide function upon success or error

    ShowAjaxLoader();
       $.ajax({
            url: "/Home/AddSong",
            type: "POST",
            data: $("#AddTopTenFavForm").serialize(),
            success: function (data) { 
              HideAjaxLoader();
              ShowMsg("Song Added Successfully"), $(container).find('ul').append('<li><a class="savedLinks" href="#" name="' + substr + '" >' + name + '</a> <span name= ' + data +' class="btnDeleteSong dontDoAnything">x</span></li>'); },
            error: function () { 
              HideAjaxLoader();
              ShowMsg("There was an error therefore song could not be added, please try again") }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've read quite a bit of the Red Bean Software SVN Book, and some
I've tried Red Gate's SQL Prompt and like it, but cannot afford it at
I have noticed that some applications (BeejiveIM) that you can put the red badge
I have a legacy database with a field which contains some parentheses, like red(b).
I'm doing a fixed sidebar that I resolved here in stack overflow , so
Say you have an enum with some elements public enum LightColor { RED, YELLOW,
we're working on a site for some really cool folks, it's here: http://journeyofaction.com it's
This post is about C# and .Net, but some info is valuable for other
I am showing current location using a red marker and some other set of
I created a CTreeCtrl but I need to mark some of the items in

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.