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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:29:10+00:00 2026-05-26T06:29:10+00:00

i have a table with a button which adds some rows to the table

  • 0

i have a table with a button which adds some rows to the table and it works fine , i want to load their parent div in the another page via jquery Load function but when i load them the button wont work anymore

here is my html code , actually i just wrote this but you get the idea and also ignore the syntax problems

<head>

<script>
$(function(){
$('#adder').click(function(){
$(this).siblings('table').append('<tr><td></td></tr>');
}
}
</script>

<head>
<body>
<div id="main">
<table> </table>
<a href="" id="adder"> </a>
</div>

</body>

in the another page altho i have the same jquery code in the header but the button doesn’t work anymore
here is my other page

   <head>
    <script>
    function loader(){
    $('#loader').load('a.php #main');
    }
    </script>
    </head>
<body>
<div id="loader"></div>
</body>

i tride to ad jq code at the end of div so when it’s loaded in the another page jq get loaded too

    <div id="main">
    <table> </table>
    <a href="" id="adder"> </a>
<script>
$('#adder').click(function(){
$(this).siblings('table').append('<tr><td></td></tr>');
}
</script>
    </div>

but still doesn’t work

///////////////////////

another question :

how can i use live when there is no event ?
for example i have a plugin which has some effects on page divs and its called on the page load time

<head> 
<script>
$(function(){
$('div').plugin(plugin settings);
})
</script>
</head>

now if i add a div to the page how should i use live so my new div get that effect ?

  • 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-26T06:29:10+00:00Added an answer on May 26, 2026 at 6:29 am
    $("body").delegate("#adder", "click", function(){
        $(this).siblings('table').append('<tr><td></td></tr>');
    });
    

    http://www.alfajango.com/blog/the-difference-between-jquerys-bind-live-and-delegate/

    The big “ah ha!” moment for me learning delegates was to simply google for the definition of delegate.

    del·e·gate    [n. del-i-git, -geyt; v. del-i-geyt] Show IPA noun,
    verb, -gat·ed, -gat·ing. noun
    1. a person designated to act for or represent another or others; deputy; representative, as in a political convention.

    It’s one of those “computer sciency” words that doesn’t make much sense until you’ve mastered the concept or googled the definition. It helps to know the definition before mastering the term. It was named “delegate” for a reason :p

    In your example, the newly created elements added by the .load() are sort of these “juveniles” or “adolescents” that are too young to handle the responsibility of events. So when you request an event from them, the browser looks to the delegate in order to learn what should happen.

    To add a plugin (your second question) to new DOM elements, you would have to enable the plugin during the load event.

    $("body").delegate("div", "load", function(this){ 
        $(this).plugin( settings ); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which has a button to Add Rows. This button adds
i have a table which contains a bunch of dynamically created radio button lists,
I have table inside a div tab. The table has 40 rows in it
So you have UINavigationController, with a parent table which has one cell --------------- |
In my iPhone application I have an update button which when being pressed adds
I have a table in which i append rows on onclick event, the row
I have table which has about 50 rows. Each row has link, but I
I have jQuery code which looks something like this on Button1 Click $('table.result_grid tbody
I have a big table containing a button in each cell. These buttons are
I have a table (in a form) populated with radio buttons (with a button

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.