Bug Tracker

Opened 11 years ago

Closed 11 years ago

#3833 closed bug (fixed)

live() does not work for a non-existent id selector

Reported by: rajiv@… Owned by: john
Priority: major Milestone: 1.3.1
Component: core Version: 1.3
Keywords: Cc:
Blocked by: Blocking:

Description

live() does not seem to work for an id selector which does not exist initially but is inserted later in DOM through AJAX. It seems to work fine if I use a class selector for the same element.

Change History (3)

comment:1 Changed 11 years ago by rajiv@…

I added one example to illustrate the issue.

<script>
    $(function() {
        $("#fooid").live("click", function() {
            alert('here');
        });
        $(".fooclass").live("click", function() {
            alert('here');
        });

        $("body").append("<a id='fooid' href='javascript:void(0)'>Click Me. I do not work.</a><br/><br/>");
        $("body").append("<a class='fooclass'  href='javascript:void(0)'>Click Me. I will work.</a>");
    });
</script>

comment:2 Changed 11 years ago by john

Milestone: 1.31.3.1
need: ReviewTest Case
Owner: changed from brandon to john
Version: 1.3

comment:3 Changed 11 years ago by john

Component: eventcore
Resolution: fixed
Status: newclosed

Fixed in SVN rev [6140].

Note: See TracTickets for help on using tickets.