Lately i have been trying to get a grasp of the anchor value from the URL using ASP.NET. From what i learned from the forum (This might be wrong since there is a way in PHP(http://www.php.net/manual/en/function.parse-url.php) to get the anchor value.)
The url above send the user to a page product and then your browser interpret the anchor and scroll down way to the description anchor. But the question is why the heck would i want to get the anchor since it’s just an anchor ? There might be several reasons for that. Here is 2 of them:
- You might not want to pass an extra parameter in your URL query string because of Referencing issues
There might be several other reasons, but these two give you and idea of what is to be achieved.
var anchorValue; var url = document.location; var strippedUrl = url.toString().split("#"); if(strippedUrl.length > 1) anchorvalue = strippedUrl;