add "enter" key to press button, encode uri component

This commit is contained in:
TheArrayser 2025-01-18 15:24:00 +01:00
parent 658314521f
commit bde336a2e2

View File

@ -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>