So basically i want run the code only if url looks like this: www.example.com/#page otherwise do not run the jquery like example: www.example.com/whatever/#page, www.example.com/whatever/whatever#page etc..,
my code:
$(window).load(function(){
if(window.location.hash == '#page'){alert('success');}
});
currently it alerts every url that contains #page. Any suggestion thanks!
try it