client.js
This file
Path
examples/search/client.js
14 lines · 375 bytes · JavaScript
Last changed by
add redis search exampleTJ Holowaychukbefore adoption315e79e
History of this fileTake it
add redis search exampleTJ Holowaychukbefore adoption315e79e
lines 1–14why, one step back12var search = document.querySelector('[type=search]');3var code = document.querySelector('pre');45search.addEventListener('keyup', function(){6 var xhr = new XMLHttpRequest;7 xhr.open('GET', '/search/' + search.value, true);8 xhr.onreadystatechange = function(){9 if (4 == xhr.readyState) {10 code.textContent = xhr.responseText;11 }12 };13 xhr.send();14}, false);