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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:29:27+00:00 2026-06-01T01:29:27+00:00

I insert dynamically some images used as buttons and add an onClick event. $(img.image_edit_customer).live(click,

  • 0

I insert dynamically some images used as buttons and add an onClick event.

$("img.image_edit_customer").live("click", function() {
    // when clicking the edit image of a row
    $(this).manipulateCustomer("editRowCustomer", {
        scope : "#customer_tbody"
    });
});

Later I want to remove the onClick event from the image used as button.

$('img[class^="image_edit"]').live('click', function() {
    // do nothing from now on
    alert('edit');
});

Now, it always executes the old and the new handler.

UPDATE

If I’m using die('click');, I can still execute the onCLick event once.

  • 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-01T01:29:29+00:00Added an answer on June 1, 2026 at 1:29 am

    For jQuery 1.7+

    To attach an event that runs only once and then removes itself:

    $(document).one("click", "img.image_edit_customer", function() {
        $(this).manipulateCustomer("editRowCustomer", {
            scope : "#customer_tbody"
        });
    });
    

    To attach an event that can be remove at a later time:

    $(document).on("click", "img.image_edit_customer", editRow);
    

    To remove the event:

    $(document).off("click", "img.image_edit_customer", editRow);
    

    Function to attach and remove

    function editRow(e) {
       $(e.target).manipulateCustomer("editRowCustomer", {
           scope : "#customer_tbody"
       });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Javascript that dynamically adds rows/fields when you click the button, Add
I'm using some embed codes that insert HTML to the page dynamically and since
I am trying to dynamically insert a set of script tags with some javascript
I'm dynamically appending some html with jQuery and I want to insert it directly
I have a class where I add some attributes dynamically and at some point
I have a query that's written dynamically (OO PHP via Joomla) to insert some
I have a Greasemonkey script that dynamically inserts an HTML form into some web
I need to dynamically insert an image in my JS code. In my Razor
I have a custom control and I want to dynamically insert a link to
I got my html document with the <html> tag, I want to dynamically insert

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.