Split HTML head, PHP, added searching tags
This commit is contained in:
parent
477efe8486
commit
340f500206
17 changed files with 262 additions and 216 deletions
16
scripts/home.js
Normal file
16
scripts/home.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const goToUser = (e) => {
|
||||
e.preventDefault()
|
||||
const formData = new FormData(e.target)
|
||||
const username = formData.get('username')
|
||||
window.location.href = `./@${username}`
|
||||
}
|
||||
|
||||
const goToTag = (e) => {
|
||||
e.preventDefault()
|
||||
const formData = new FormData(e.target)
|
||||
const tag = formData.get('tag')
|
||||
window.location.href = `./tag/${tag}`
|
||||
}
|
||||
|
||||
document.getElementById('username_form').addEventListener('submit', goToUser, false)
|
||||
document.getElementById('tag_form').addEventListener('submit', goToTag, false)
|
||||
Loading…
Add table
Add a link
Reference in a new issue