Are you attaching the click handlers before or after you load the ajax
content?

If you're trying to apply the click handler before, it won't work
because the anchors don't exist yet.

Either apply the click handler after the content is loaded, or use a
plugin like LiveQuery to handle updates for you.

On Jul 15, 6:48 am, Pete <[EMAIL PROTECTED]> wrote:
> I want the index page to manage the links on the page that's loaded into the
> div via ajax.
>
> So in the index page, I'll try to attach the click event handler like :
> $('a#myanchor').click(function(){//dosomething});
>
> in the imported page, the anchor looks like: <a href="url"
> id="myanchor">link</a>
>
> On Mon, Jul 14, 2008 at 2:36 PM, Brian J. Fink <[EMAIL PROTECTED]>
> wrote:
>
>
>
>
>
> > What syntax are you using for the anchors themselves?
>
> > On Jul 14, 2:00 pm, Peter Benoit <[EMAIL PROTECTED]> wrote:
> > > Hi all,
>
> > > I have an "index" page with a div, that I $
> > > ('#mydiv").load('mypage.html') into.
>
> > > The problem I'm having is, I have anchors on "mypage" that I would
> > > like to effect with the click event on the "index" page.  Trying to
> > > access these loaded anchors via $('a#anchorid').click(...), isn't
> > > working.  Can someone show me how to handle this?
>
> > > Thanks!
> > > -pete- Hide quoted text -
>
> - Show quoted text -

Reply via email to