Page is a not externally linkable
Drag_Racer - 10:31 am on Apr 27, 2007 (gmt 0)
I was half thinking a 'replace' on the regex... a little sleepy I just tested this in IE5.5, OP6.06, FF1.5 now you can figure out how to grab the keystroke with out the input, cause you have to scroll back up the page to enter a new letter. adding focus back to the input kind of defeats the whole thing as the page scrolles back to it. you could have the input follow you around the page, maybe... <script type="text/javascript"> <form autocomplete='off'><input id="myInput" onKeyUp="goTO()"></form> <a name="b"><!-- --></a><h1>header b</h1> <a name="c"><!-- --></a><h1>header a</h1> <a name="d"><!-- --></a><h1>header b</h1> <a name="e"><!-- --></a><h1>header a</h1> <a name="f"><!-- --></a><h1>header b</h1>
ok, I had errors...
and the onChange event won't fire until the input looses focus
you need to add the autocomplete=off to the form else you get an exception error for the autocomplete in FF.
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>
<a name="a"><!-- --></a><h1>header a</h1>