<script type="text/javascript">
if (location.href.indexOf("#") != -1) {
// Your code in here accessing the string like this
// location.href.substr(location.href.indexOf("#"))
alert('hello');
}
</script>
I found this script in another answer. Is there a way for me to use the
("#") != myParameter)
So if the hash meets my parameter do something.
Thank you.
Do this:
This takes the hash, chops off the “#”, and compares it to
myParameter.You could also compare directly to a string:
If you want the “#” when comparing, use
location.hashinstead oflocation.hash.substr(1).