views:

2391

answers:

5

I want to do this: http://docs.jquery.com/Events/live#typefn

Only .live() doesn't support the change event- any ideas for work arounds?

Need to bind a function to some on-the-fly DOM elements, but not until change.

A: 

Before there was .live() in jQuery 1.3, I had great success with Arial Flesler's "listen" plugin.

http://flesler.blogspot.com/search/label/jQuery.Listen

I believe you should be able to do this on the change event with this plugin.

Funka
+2  A: 
Bobby
You'll probably find that this has the (unwanted) effect of binding and re-binding your change function multiple times...
Funka
hm- i hadn't thought of that but you are obviously right. Since I won't need the function to work for the clicked/changed element again, would an acceptable solution be to $(this).removeClass("fu") at the end of my change function?
Bobby
duh, answer to that one is obviously no... hmmmm seems like there must be a creative solution here that doesn't require a plug-in, i'll keep thinking about it.
Bobby
+2  A: 
Bobby
+2  A: 

LiveQuery plugin supports all events.

pestaa
+1  A: 

Note: jQuery 1.4 now supports the live function for all normal events. It didn't work with IE8 until recently, but I believe this is fixed with jQuery 1.4.2. See this resolved jQuery ticket: IE8 DOES NOT SUPPORT THE CHANGE EVENT WHILE USING LIVE

Gabe Hollombe