client.js
This file
Path
examples/search/client.js
13 lines · 374 bytes · JavaScript
Last changed by
Merge pull request #2008 from agchou/clean-up-codeJonathan Ongbefore adoption2e830ff
History of this fileTake it
The walk stopped after 200 commits: lines older than 34c83d7 point at it.
3.4.7Jonathan Ongbefore adoption34c83d7
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);