Side navigation
#3833 closed bug (fixed)
Opened January 13, 2009 12:16PM UTC
Closed January 20, 2009 04:01PM UTC
live() does not work for a non-existent id selector
| Reported by: | rajiv@manusis.com | 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.
Attachments (0)
Change History (3)
Changed January 13, 2009 12:31PM UTC by comment:1
Changed January 15, 2009 02:00PM UTC by comment:2
| milestone: | 1.3 → 1.3.1 |
|---|---|
| need: | Review → Test Case |
| owner: | brandon → john |
| version: | → 1.3 |
Changed January 20, 2009 04:01PM UTC by comment:3
| component: | event → core |
|---|---|
| resolution: | → fixed |
| status: | new → closed |
Fixed in SVN rev [6140].
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>