Page 1 of 1

jquery question

Posted: Sat Jan 24, 2009 6:35 pm
by daedalus__
lets say daedalus has a page where he gets some content with jquery

he hides the content container makes the request with the get method changes the content of the content container then shows the content container

that works fine and dandy but now consider that there is content in the new page that needs to be checked for elements that jquery may have something to say about

what does he do then?

Re: jquery question

Posted: Sat Jan 24, 2009 6:47 pm
by pickle
You're wondering how to attach listeners to the content you retrieve via AJAX?
  1. Use the new .live() function in jQuery 1.3.1 . However, I've had issues with it in IE7 OR
  2. After you load the content, call a callback function that re-attaches the necessary listeners

Re: jquery question

Posted: Sat Jan 24, 2009 7:01 pm
by daedalus__
i was considering using the live function but these handlers are going to be specific to each page and i didnt think that was the intention of the function. would it be appropriate to use getScript() in a callback to attach the correct handlers to the page being loaded?

Re: jquery question

Posted: Sat Jan 24, 2009 7:09 pm
by daedalus__
eh answered my own question

thanks!