add "enter" key to press button, encode uri component
This commit is contained in:
parent
658314521f
commit
bde336a2e2
11
query.html
11
query.html
@ -99,7 +99,16 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.location.href = window.location.protocol + "//" + contents + "." + window.location.hostname;
|
document.location.href = window.location.protocol + "//" + encodeURIComponent(contents) + "." + window.location.hostname;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload = (event) => {
|
||||||
|
document.getElementById("name").addEventListener("keypress", function(event2) {
|
||||||
|
if(event2.key == "Enter") {
|
||||||
|
event2.preventDefault();
|
||||||
|
document.getElementById("button").click();
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user