I have a div which is invisible by default, and
becomes visible via slidetoggle when a button is
clicked. Inside the div is dynamic content via ajax --
i take the responseText of an ajax call, and then
append it to an empty div (inside the slidetoggled
div) via .html(ajaxreponsevar). I do it this way
because I use the same div for multiple bits of
dynamic content, a different bit depending on which
button is clicked.

This approach works fine for getting/showing the
dynamic content. However, now I'm trying to add a
click event to an image inside that dynamically
generated content, and it's not working. I am thinking
this is maybe because my jquery bind events and such
are loaded once on page load (in a php file), and and
thus can't bind to something that doesn't exist yet?

I also tried ("divstuff img").bind(click, function(){
...etc (which I think is the same thing as just saying
divstuff img.click()) but that didn't work either. 

I'm guessing there's some sort of trick to binding
events to dynamic content? 

thanks!
-kim


 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to