Skip to content

Commit

Permalink
fix console log
Browse files Browse the repository at this point in the history
  • Loading branch information
RohanSSS committed Mar 29, 2019
1 parent 5f0b9bf commit 39d14ef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ let input = document.getElementById("inputBox");

input.addEventListener("change", function(e) {
const inputValue = e.target.value;
const sendUrl = `/query=${inputValue}`;
const sendUrl = `/query=${inputValue}`;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
console.log(JSON.parse(response));
console.log(JSON.parse(xhr.response));
}
}
};
Expand All @@ -16,7 +16,6 @@ const sendUrl = `/query=${inputValue}`;
xhr.send(inputValue);
});


// const input2 = document.getElementsByName('plants');
// const optionElem = document.createElement("option");
// optionElem.textContent =
// optionElem.textContent =

0 comments on commit 39d14ef

Please sign in to comment.