jquery question

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

jquery question

Post 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?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: jquery question

Post 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
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: jquery question

Post 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?
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: jquery question

Post by daedalus__ »

eh answered my own question

thanks!
Post Reply