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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:28:46+00:00 2026-05-16T14:28:46+00:00

OK, so, I use livequery() to bind a function to the click event of

  • 0

OK, so, I use livequery() to bind a function to the click event of all links of class ‘ajaxLink’. The function fires perfectly…once. After the first successful ajax call on a click, subsequent clicks don’t fire the ajax, which means (I’m guessing) they aren’t being bound by the livequery() code anymore.

I saw where others who had a similar issue moved their code outside the ready() function, so I tried that, to no avail (same results).

$('a.ajaxLink').livequery('click', function(e) {
  e.preventDefault();
  var target = $(this).attr('href') + '&ajax=y';
  var x = $(this).html();

  $.ajax({
   type: 'POST',
   url: target,
   //data: str,
   success: function(msg) {
    $('#mainPanel').slideUp(500, function() {
     $(this).html(msg).slideDown(1000);
    });
   }
  });
 })

Let me know if you need more detail. Thank you in advance for your help! This site is excellent.

  • 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-16T14:28:47+00:00Added an answer on May 16, 2026 at 2:28 pm

    .livequery() has issues depending on which version and some special DOM cases. However, you can ignore that problem…since you’re doing something that works off events, you can use the built-it .live() here (available in jQuery 1.3+), like this:

    $('a.ajaxLink').live('click', function(e) {
      e.preventDefault();
    
      $.ajax({
        type: 'POST',
        url: $(this).attr('href') + '&ajax=y',
        //data: str,
        success: function(msg) {
          $('#mainPanel').slideUp(500, function() {
            $(this).html(msg).slideDown(1000);
          });
        }
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't understand why livequery doesn't bind the event, but I have to use
Use cardova 2.0.0. After Compilations app show error: Could not find class 'android.webkit.WebResourceResponse', referenced
I am attempting to use livequery. I unfortunately am stuck using jquery 1.2.6. This
I am using livequery for my project for attaching events in links in table/grid.
When I use the following, I see all divs static and dynamic one by
The question says it all. Which one is better and when to use what,
I dynamically load HTML elements.. and used livequery() plugin to handle click events.. but
Use paperclip for my images. Models: class Country < ActiveRecord::Base has_many :regions has_many :assets,
I use jquerylive plugin to add additional css classes to .field-validation-error class like this:
Use Case Show a photo uploaded by the user in a square box with

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.