defunkt/jquery-pjax — pull request #151 by spantaleev (2012-06-06 07:36:58+00:00)
Title: Ignore empty anchors on the same page

Trailing (empty) anchors get treated differently and were not ignored
when PJAXing, like other anchor links for the same page.

For links with regular non-empty anchors, link.hash is something like
'#hash' and link.href is just the plain URI without the hash.

For links with an empty anchor (trailing #), link.hash is empty ('') and
link.href contains the original URI with the trailing # in it.

This patch adds some additional logic to catch that second special case.

Here's an example that illustrates the problem and its solution - http://jsfiddle.net/dY6te/1/
We're looking at the first link, the special case, which wouldn't normally be ignored by PJAX.