Isn't the problem obvious, or am I stupid? In the next function, you process clicks on the map, you listen to clicks, hold them for 500ms , and then perform your function.
$("#tab2.tab_content #map").delayed('click', 500, function() { state = window.location.hash.substring(1); alert(state); jsonLink = 'http://ml.uscm.org/ministries.json?state=' + state + '&active=true&callback=?'; getMapResults(); return false; });
But at the point where you alert your state , it is empty because you have not installed it yet. Your return false; also will not allow the browser to change the hash.
Try this function, and I bet you will get something:
$("#tab2.tab_content #map").delayed('click', 500, function() { setTimeout(function(){ var state = window.location.hash.substring(1); alert(state); jsonLink = 'http://ml.uscm.org/ministries.json?state=' + state + '&active=true&callback=?'; getMapResults(); }, 500); });
A quick way to make it work:
$("#tab2.tab_content #map a").delayed('click', 500, function(e) { state = $(this).attr('href').replace('#', ''); alert(state); });
you can easily change the hash manually by adding this to the callback:
window.location.hash = state;
but your real problem is that your a (anchors) don't change the hash itself, which makes it seem like there is something in your code that stops it.