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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:29:32+00:00 2026-05-23T12:29:32+00:00

SO I have a setup with a few links as follows <a class=someclass href=http://www.google.com

  • 0

SO I have a setup with a few links as follows

<a class="someclass" href="http://www.google.com" id="link01">Google</a>
<a class="someclass" href="http://www.yahoo.com" id="link02">Yahoo</a>
<a class="someclass" href="http://www.cnn.com" id="link03">CNN</a>
<a class="someclass" href="http://www.facebook.com" id="link04">Facebook</a>

$(".someclass").click(function() {
            var currentId = $(this).attr('id');
            var data = "do=clearthis&id=" + currentId;

              $.ajax({
                 type: "POST",
                  url: "clearance.php",
                  data: data,
                  success: function(msg){
                   }
                 });
               });
});

What I am doing is tking the link that is clicked, obtaining an id value from the link and ajax submitting that to my PHP file which will remove the link from my database.

So that when a user clicks on a link, that link is removed from my database. However, the problem is that its not actually working. I htink the problem is that its too fast, as jquery begins to POST that form for me, its already jumping to the target link. Is there any way to induce some kind of delay to allow my clearance.php to process the removal before allowing the user to continue to the target link?

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-23T12:29:32+00:00Added an answer on May 23, 2026 at 12:29 pm

    Make a synchronous AJAX request so that it completes first:

    $.ajax({
      type: "POST",
      async: false,
      url: "clearance.php",
      data: data,
      success: function(msg){
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few Windows Services written in C# that I have setup to
I am trying to setup a few fixes in some code that have caught
I have a few users setup in the web.config of an asp.net site to
I've setup Netbeans using nbandroid (http://kenai.com/projects/nbandroid) which has been working just fine for the
I have a few tables in a MySQL database similar to this setup: major
I have setup web dav on windows server 2008. It seems to work fine
I have setup a property and implement INotifyPropertyChanged like so... public event PropertyChangedEventHandler PropertyChanged;
I have setup svnserve and for now now I am testing a repository with
I have setup multiple SQL Service Broker Queues in a database but have not
I have setup coredata in my appDelegate, but it first loads the mainWindow.xib and

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.