Page is a not externally linkable
Drag_Racer - 8:47 am on Apr 27, 2007 (gmt 0)
var myID = false; now 'myID' contains everything after the '#' in your url if you need it ... or just rewrite your window.location with a new hash upon keystroke as below <script type="text/javascript"> <form><input id="myInput" onChange="goTO()"></form> maybe I'm just missing something your trying to do, but the above should navigate around a page. Even if the page does refresh, the hash will still make the uri good to your destination...
instead of worrying about the hash, you could use it instead of a search param (query string)
if(window.location.hash && window.location.hash!= "#"){
myID = window.loacation.hash.substring(1,window.location.hash.length);
}
function goTO(){
var myID = document.getElementById('myInput').value;
document.getElementById('myInput').value = '';
var fixurl;
if(window.location.hash){
fixurl = window.location.href.replace( /.+#(.*)/, myID);
}
else {
fixurl = window.location + "#" + myID;
}
window.location = fixurl;
}
</script>