javascript - jQuery Plugin to Update URL Hash As Text Input Changes -


is there jquery plugin update url hash of page user types text text input?

i know rather simple, looking "smart" one, such google instant search or caniuse.com, doesn't update hash on every keyup() event, rather when user has stopped typing given period of time or text input blurs.

i know sit down , write plugin myself, have written several before, hoping suggest 1 has been written don't have reinvent wheel.

thank time.

not difficult. untested code:

var hashto; $('#mytextfield').on('keyup', function() {     if(hashto !== undefined) {         cleartimeout(hashto);     }     hashto = settimeout(updatehash, 1000); });  function updatehash() {     var hashval = encodeuricomponent($('#mytextfield').val());     window.location.hash = hashval; } 

demo: http://jsfiddle.net/vent6/show/

code: http://jsfiddle.net/vent6/


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

php - HTTP_REFERER woes: How can I allow access to a specific page, only when a visitor has visited another specific page beforehand? -