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 6129549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:45:20+00:00 2026-05-23T16:45:20+00:00

I have a number of edit links which remotely pull on an edit form,

  • 0

I have a number of edit links which remotely pull on an edit form, which is brought up in an overlay. In order to give feedback to users I have a span which replaces the original edit-tester link while the call is being made. Upon completion the span is removed correctly. The problem is, when clicking on the same link again 2 ‘thinking’ spans appear. When clicked again 3 appear and so on.

Could anyone advise on why this is and how to fix it based on the sample code below?

I obviously want only 1 ‘thinking’ span to appear whenever the link is pressed, not multiplicities dependent on the number of clicks.

Any pointers would be greatly appreciated!

$('a.edit-tester').click(function() {
  $(this).bind('ajax:beforeSend', function() {
    $(this).toggle();
    $(this).after('<span class="thinking">Thinking</span>');
  }).bind('ajax:success', function() {
   $('span.thinking').remove();
    $(this).toggle(); 
}).bind('ajax:error', function(){
     $('span.thinking').remove();
     $(this).toggle();  
   });
});

My only guess is that the actual ‘thinking’ span is not being removed from the DOM. Other than that it’s anybody’s guess…

EDIT: Edited the first line of the code above… I forgot to change it back after messing around with it.

  • 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-23T16:45:21+00:00Added an answer on May 23, 2026 at 4:45 pm

    You’re binding additional copies of the send event to the link with each click. See how

     $(this).bind('ajax:beforeSend', function() {...}
    

    is actually done each time the link is clicked? You could probably move that block to before or after the parent function and it’d work fine.

    Edit: To clarify, it appears that you’re chaining all your events into a single expression. Chaining in jQuery is powerful, but this isn’t what it’s for. Without seeing more of your source I can’t suggest a specific implementation, but for just adding the “thinking” DIV this will do the job:

    $('a.edit-tester').live('click', function() {
        $(this).toggle();
        $(this).after('<span class="thinking">Thinking</span>');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number of tracks recorded by a GPS, which more formally can
I have a number of data classes representing various entities. Which is better: writing
I have a DataTable, which has a number of columns. Some of those columns
I have a float number which represent percentage (0.0 to 100.0) % float represent
I have a number of pages that include the same partial view which contains
I have this simple MVC 3 application which simply has two controllers(Home and Edit),
I'm developing a housing app with a number of houses which each have attributes.
I am reading in a number of strings which have / 'es through them,
I'm working on a project were we have number (5 at the moment) of
I'm stuck with the following scenario and appreciate any help/advice.. Requirement I have number

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.