A different take would be to never automatically push the results to the url bar, but still parse the address bar for queries, and provide a permalink for each result with the hash in it.
The way I solved this in a similar auto-complete app was using a setTimeOut to prevent updating or requesting data unless no key had been pressed in the last 0.2 seconds or so:
var updateId = 0;
function searchKeypress(e) {
if ((e || window.event).keyCode == 13) {
updateCookie(radioStations.selected);
document.location = radioStations.selected.links[0].url;
}
clearTimeout(updateId);
updateId = setTimeout(searchUpdate, 200);
}
Disclaimer: this piece of code is about 4 years old and as you can see it doesn't even use jQuery, but I trust it demonstrates the principle well enough.Data is scraped mostly from MDN using node-scraper and then thrown into mongodb for storage.
Backend is also node and just provides a json endpoint for pulling the entire db client-side (along with serving up index.html and all the client-side js).
Frontend is all backbonejs, which makes writing the search function pretty insanely simple: https://github.com/rgarcia/instacss/blob/master/static/js/vi...
Both backend and frontend code is organized using requirejs, which I am pretty much in love with.
Since then I've added a few features, one of which being the ability to have permalinks so that you could use it as a google chrome search. This is why I push to the url bar as you type. I'm really open to feedback on how to do this without screwing with people's back buttons, since I agree that's pretty bad.