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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:13:24+00:00 2026-06-12T00:13:24+00:00

This is my first post so I hope I am not violating any rules.

  • 0

This is my first post so I hope I am not violating any rules. I have searched quite extensively, but possibly may have not looked for the correct terms that I am looking to resolve.

At any rate, my problem is this:
I have a table generated with a list of items, the left-most column has a button when clicked calls an ajax Post and or load function to query the history of the item and list it below the table. This works in its true sense of the expected result, however, reviewing the console through FireBug, subsequent clicks on buttons in the list result in the doubling of posts. ie. 1st click shows 1 console event, 2nd click shows 2 console events, 3rd click shows 4 console events, and so on. this continues until I select a different location and the count resets.

The below is what I see in the console. This presents a problem with timing as each subsequent post takes longer.

clicking the hist-tag button 5365

>GET http://localhost/digipens/query.php?rec_id=5365

clicking the hist-tag button 5365

>GET http://localhost/digipens/query.php?rec_id=5365

clicking the hist-tag button 5365

>GET http://localhost/digipens/query.php?rec_id=5365

clicking the hist-tag button 5365

>GET http://localhost/digipens/query.php?rec_id=5365

code:

$('.hist-tag').click(function(){

  var ID=$(this).closest('tr').attr('id')

  itemid  = $("#itemid_input_"+ID).val();
  dataString = '?rec_id='+ID;

  $('#item_hist').load('query.php' + dataString); 

});

Any ideas or different ways to accomplish the same goal would be excellent.

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-06-12T00:13:26+00:00Added an answer on June 12, 2026 at 12:13 am

    I suspect your click event is somehow being re-bound on each return.
    Perhaps the same script is included in the response from your load call?

    Try this:

    $('.hist-tag').off('click');
    $('.hist-tag').on('click', function(){
        var ID=$(this).closest('tr').attr('id');
        itemid=$("#itemid_input_"+ID).val();
        dataString = '?rec_id='+ID;
        $('#item_hist').load('query.php' + dataString);
        return false;  // prevents bubbling the click to the container
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope I'm not duplicating a post; but I didn't quite know what to
this is my first post on stackoverflow. I hope my question is not to
My first post here, so i hope this is the right area. I am
Edited at the request of commenters. I hope this is compliant. First post! Trying
This is my first time here so I hope I post this question at
This is my first post and I my first experience with jquery. I have
This is my first post, thx, you've been very helpful. But I'm stuck. I
This is my first post here. I have a problem. I need to take
This is my first post, I hope the phrasing of my question makes sense,
My first post on this site with huge hope:: I am trying to understand

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.