so I have a url which could be mywebsite.com/index.html#Jobs
I first need to get the name after the hash which I do by
var $ext = $(location).attr('hash');
$ext= $ext.replace("#","");
the problem is know when this hash tag has changed on a live event and not a page refresh
this is what i have tried
var $ext = $(location).attr('hash');
$ext.('change', function() {
console.log("changed");
});
I know this doesnt work as $ext isnt an element but would like some help.
any ideas very welcome.
Use This Plugin : http://benalman.com/projects/jquery-hashchange-plugin/
And Use This Code:
You can also use but some compatibility issues :
And for checking whether browser supports hashchange: