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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:13:55+00:00 2026-06-01T06:13:55+00:00

I have a div like this <section class=item_container> <article class=item> <h2>Page Title</h2> <p><a class=delete_page

  • 0

I have a div like this

<section class="item_container">

<article class="item">
    <h2>Page Title</h2>
    <p><a class="delete_page" href="http://www.abc.com/delete/1/">delete</a></p>
</article>

<article class="item">
    <h2>Second Page Title</h2>
    <p><a class="delete_page" href="http://www.abc.com/delete/2/">delete</a></p>
</article>

</section>

And i am using this code to remove/delete items from item_container

$('a.delete_page').live('click', function(e){
    e.preventDefault();
    $('footer#ajax_footer').html('')
    $('footer#ajax_footer').show("slide", { direction: "down" }, 500);

    var url = $(this).attr("href");
    var parent_div = $(this).parents("div").parent("article");
    var title = $(this).parents("div").parent("article").find('h2').html();

    $('footer#ajax_footer').html('<h2>Are you sure you want to delete <u>'+ title +'</u> Page</h2><p>'+ url +'</p><p><a href="#" class="delete_this_page">Yes, Please Delete It</a></p>');

    $('a.delete_this_page').live('click', function(e){
        e.preventDefault();
        parent_div.remove();
        $('footer#ajax_footer').html('').slideUp();
        $.sticky('<b>Page Deleted</b><p><u>'+ title +'</u> Page has been successfully deleted.</p>');
    });

});

All the contents are loaded via Ajax and there are few more div in each article and there are 30+ articles.

The problem is i am using Sticky plugin to display notification after every item is deleted and it’s working fine, Everything is working fine, But after i delete an Article, The sticky notification of previous deletion is displayed as well.

Like, After i delete an item, i see 1 sticky notification, After i delete second item i see 2 sticky notifications (1 of this and 1 of previous) i only want to see 1, And For every item i delete it display all the previous sticky notifications + 1.

Hope i made it clear enough, Thanks guys.

  • 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-01T06:13:56+00:00Added an answer on June 1, 2026 at 6:13 am

    The problem you have is that every time you click on a a.delete_page element you’re setting up a new click event handler using .live(), so for each subsequent click you get one more event handler that gets run.

    The whole point of .live() – though, as a side note, it’s deprecated; consider using .on() (jQuery 1.7+) or .delegate() (prior to 1.7) – is that it handles events triggered by dynamically added elements. Call this:

    $('a.delete_this_page').live('click', function(e){
            e.preventDefault();
            parent_div.remove();
            $('footer#ajax_footer').html('').slideUp();
            $.sticky('<b>Page Deleted</b><p><u>'+ title +'</u> Page has been successfully deleted.</p>');
        });
    

    outside of your other callback function (in your $(document).ready()), and find another way to identify parent_div. Or, bind the click event to that specific link directly inside the callback handler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like this: <div class=content> <a href=#>A</a> </div> <div class=content> <a href=#>B</a>
I have a section of html that looks like this: <div id=faq-content> <div class=faq-topic
first some code: I have many elements like that: <section class=item> <div class=caption> </div>
I have a web site like this: <html xmlns=http://www.w3.org/1999/xhtml> <head> <title></title> <link rel=stylesheet type=text/css
I have a DOM structure that looks like this: <div class=chapter> <section></section> <section></section> </div>
I have an html like this: <div id=container1> <div class=dragme>drag me</div> </div> <div id=container2>
I have an element like this: <div id=foo_<?php echo $id;?> class=hidden></div> I'm trying if
Suppose to have a code like this: <div class=notSelected> <label>Name <input type=text name=name id=name
I'm using the cycle plugin on some divs, like this: <div class=sections> <div class=Section>
I have a Div layer like this ... <style type=text/css> <!-- #newImg { position:absolute;

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.