[jQuery] Using "window.location.hash" for URLs without plugin
Hi,<div>
</div><div>I'm trying to use URL's such as '<a href="http://mysite.com/#contact">mysite.com/#contact</a>' that will show a certain div.</div><div>I have my function written and working to show the div, currently being used as "$("#a.contact").click(showContact);"
</div><div>
</div><div>How would I use something like "<span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">window.location.hash" to fire off the function "showContact" for example, if the URL was /#contact?</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">This would need to provide for about 3 pages, Home, About, Portfolio and Contact.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">I know there's a plugin for enabling use of the back button etc, but I'd rather something simple without having to load plugins.</span>
</div><div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">Many thanks,<span class="Apple-style-span" style="border-collapse: separate; white-space: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "></span></span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><span class="Apple-style-span" style="border-collapse: separate; white-space: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">Alex</span></span></div>