Check if id is set in URL, if not, add it?

Check if id is set in URL, if not, add it?

Hello all,

I've built a single page site that uses div id tags in the URL and Jquery to handle navigation (index.php#home, index.php#about, etc.)

Whenever the user visits index.php and clicks a link, it takes 2 clicks to make the navigation kick in; I believe this is because it's missing an ID tag. Once it's set to index.php#home, index.php#about, etc. it works fine.

Is there anyway to check if an id is assigned in the url and if not, add #home to it?