If the link is to an anchor on the same page then (unless AJAX or some
other JavaScript is involved) the page will not reload, and so the
.ready functions will not fire.

What do you want to happen when someone clicks a "#top" link?

You can bind a click handler to the link(s) like so:

$(function(){
  $('a[href="#top"]').click(function(){
    // do something here
  });
});

Karl Rudd

On Thu, Oct 16, 2008 at 4:43 AM, chewie124 <[EMAIL PROTECTED]> wrote:
>
> This seems like somebody should have come across this bug before, but
> my searches haven't turned up anything...
>
> So I'm working on a Drupal application, and when I hit a URL on it,
> for example at http://localhost/node/13, jquery loads up fine,
> document.ready() fires, and all the jQuery goodness is on the page.
>
> Here's a little html snippet:
> ....
> <body>
> <a name="top"/>
> ....
> ....
> ....
> <a href="#top">goto top of page</a>
> ....
>
> if I click on the 'goto top of page'  link, everything that's done in
> the document.ready() function is lost, and there's no more jQuery
> goodness on my page.
>
> Also, if I hit http://localhost/node/13#top, the document.ready()
> function doesn't fire also.
>
> Can somebody point me in the right direction on how to fix this?
>
> Thanks!
>

Reply via email to