window.location.hash
When using a link for a javascript action, I usually do something like this:
<a href="#">Link Text</a>
That way, when someone clicks the link before the page loads nothing terrible happens.
Html Base Tag
On my current project I use this same construct, but with a base tag:
<html>
<head>
<base href="http://example.com/" />
</head>
<body>
<a href="#">Link Text</a>
</body>
</html>
However, if the page url is:
http://example.com/dir/page
clicking the link navigates to
http://example.com/#
rather than
http://example.com/dir/page#
How can I fix this?