client.js
This file
Path
examples/search/client.js
13 lines · 374 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 6bc7574 point at it.
docs: typo fixesDouglas Christopher Wilsonbefore adoption6bc7574
lines 1–13why, one step back1var search = document.querySelector('[type=search]');2var code = document.querySelector('pre');34search.addEventListener('keyup', function(){5 var xhr = new XMLHttpRequest;6 xhr.open('GET', '/search/' + search.value, true);7 xhr.onreadystatechange = function(){8 if (4 == xhr.readyState) {9 code.textContent = xhr.responseText;10 }11 };12 xhr.send();13}, false);