commit
c38e704ecb
1 changed files with 10 additions and 8 deletions
|
@ -3,15 +3,17 @@ window.onload = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function initSearchBar() {
|
function initSearchBar() {
|
||||||
document.getElementById("search-bar-input").value = ""
|
const searchBarInput = document.getElementById("search-bar-input")
|
||||||
document.getElementById("search-bar-input").focus()
|
|
||||||
|
|
||||||
document.getElementById("search-bar-input").addEventListener("keypress", (event) => {
|
searchBarInput.value = ""
|
||||||
if (event.key != 'Enter') return
|
searchBarInput.focus()
|
||||||
|
|
||||||
googleSearchUrl = "https://www.duckduckgo.com/?q="
|
searchBarInput.addEventListener("keypress", (event) => {
|
||||||
otherThing = "&atb=v225-7&ia=web"
|
if (event.key !== 'Enter') return
|
||||||
query = document.getElementById("search-bar-input").value.replace(/\ /g, "+")
|
|
||||||
document.location = googleSearchUrl + query + otherThing
|
const searchEnginer = "https://www.duckduckgo.com/?q="
|
||||||
|
const endQuery = "&atb=v225-7&ia=web"
|
||||||
|
|
||||||
|
document.location = searchEnginer + searchBarInput.value.replace(/\ /g, "+") + endQuery
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue