Getting the data after the hashmark in a query string is simple. Here is an example used for when a client accesses a glossary of terms from a book. It takes the name anchor delivered (#tesla), and delivers the client to that term and highlights the term and its description in blue so its easy to see.
A. setup your strings with a div id, so the name anchor goes where its supposed to and the javascript can change the text colors
<div id="tesla">Tesla</div>
<div id="tesla1">An energy company</div>
B. Use Javascript to do the heavy work, on the server side, inserted in your PHP page, or wherever..
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
C. I am launching the java function automatically when the page is loaded.
<script>
$( document ).ready(function() {
D. get the anchor (#tesla) from the url received by the server
var myhash1 = $(location).attr('hash'); //myhash1 == #tesla
E. trim the hash sign off of it
myhash1 = myhash1.substr(1) //myhash1 == tesla
F. I need to highlight the term and the description so i create a new var
var myhash2 = '1';
myhash2 = myhash1.concat(myhash2); //myhash2 == tesla1
G. Now I can manipulate the text color for the term and description
var elem = document.getElementById(myhash1);
elem.style.color = 'blue';
elem = document.getElementById(myhash2);
elem.style.color = 'blue';
});
</script>
H. This works. client clicks link on client side (xyz.com#tesla) and goes right to the term. the term and the description are highlighted in blue by javascript for quick reading .. all other entries left in black..