On Sat, Dec 13, 2008 at 5:05 PM, ray <rayjohnterr...@gmail.com> wrote:
>
> It appears that the .children portion of the code either isn't getting
> the .ajax_link classes, or the click handler isn't getting correctly
> applied.  Is there a way to determine what the actual results returned
> are by the following:
>
>   $(this).children('.ajax_link')
>
> i tried something like:
>
>   var kids = $(this).children('.ajax_link');
>   alert(kids);

That will look for any elements with className 'ajax_link' among the
immediate children of whatever $(this) is.

alert(kids.length); would tell if you if the selector retrieved anything.

> i replaced the children section with the following (it looks to be
> working correctly now) to grab all of the ajax_link classes, but i'd
> still like to know what i was doing wrong w/ the above as well, as i
> feel like the above is a little clearer:
>
>   $(".ajax_link").click(my_click);

That will apply the click handler to all .ajax_link elements in the
document, regardless of what their parents are.

Reply via email to