structure.html:
<button>Go!</button>
behavior.js, remove this:
$.b.onmouseup = function() { this.doStuff(); };
... and substitute this:
$.q.value = ''; $.lastQuery = ''; setInterval(SEARCH.doStuff, 1000);
$.lastQuery is a private variable that will hold the previous query. doStuff will run every second, which is plenty of time for people to type. And we need to set $.q.value to nothing on load, or else it can get really annoying for repeat visitors.prev - http://kentbrewster.com/build-a-search-app/code/code7.html - next