views:

177

answers:

1

A bit of a basic question but how may I check if a anchor is in the url when I load the page?

For example www.mysite.com/mypage#show

And then in the JavaScript I can go if #show exists do this

Thanks.

+1  A: 

plain js:

if( window.location.hash == '#show' )
David Hedlund
THank you, perfect!
Podlsk