123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- console.log("JS Loaded")
- const url = "127.0.0.1:3000"
- var inputForm = document.getElementById("mainUpdateTopicList")
- inputForm.addEventListener("submit", (e)=>{
- //prevent auto submission
- e.preventDefault()
- const formdata = new FormData(inputForm)
- fetch(url,{
- method:"updateMainTopicList",
- body:formdata,
- })
- .then(
- response => response.text()
- ).then(
- (data) => {document.getElementById("mainTopicList").innerHTML=data}
- ).catch(
- error => console.error(error)
- )
- })
- var inputForm = document.getElementById("mainUpdateInterests")
- inputForm.addEventListener("submit", (e)=>{
- //prevent auto submission
- e.preventDefault()
- const formdata = new FormData(inputForm)
- fetch(url,{
- method:"updateMainInterests",
- body:formdata,
- })
- .then(
- response => response.text()
- ).catch(
- error => console.error(error)
- )
- })
- var inputForm = document.getElementById("archiveUpdateTopicList")
- inputForm.addEventListener("submit", (e)=>{
- //prevent auto submission
- e.preventDefault()
- const formdata = new FormData(inputForm)
- fetch(url,{
- method:"updateArchiveTopicList",
- body:formdata,
- })
- .then(
- (data) => {document.getElementById("archiveUpdateTopicList").innerHTML=data}
- ).catch(
- error => console.error(error)
- )
- })
- var inputForm = document.getElementById("archiveUpdateInterests")
- inputForm.addEventListener("submit", (e)=>{
- //prevent auto submission
- e.preventDefault()
- const formdata = new FormData(inputForm)
- fetch(url,{
- method:"updateArchiveInterests",
- body:formdata,
- })
- .then(
- response => response.text()
- ).catch(
- error => console.error(error)
- )
- })
- var inputForm = document.getElementById("archiveUpdateTopicList")
- inputForm.addEventListener("submit", (e)=>{
- //prevent auto submission
- e.preventDefault()
- const formdata = new FormData(inputForm)
- fetch(url,{
- method:"updateArchiveTopicList",
- body:formdata,
- })
- .then(
- (data) => {document.getElementById("displayArchiveTweets").innerHTML=data}
- ).catch(
- error => console.error(error)
- )
- })
- var inputForm = document.getElementById("mainTweets")
- inputForm.addEventListener("submit", (e)=>{
- //prevent auto submission
- e.preventDefault()
- const formdata = new FormData(inputForm)
- fetch(url,{
- method:"getTweets",
- body:formdata,
- }).then(
- (data) => {document.getElementById("displayMainTweets").innerHTML=data}
- ).catch(
- error => console.error(error)
- )
- })
- var inputForm = document.getElementById("inputTweet")
- inputForm.addEventListener("submit", (e)=>{
- //prevent auto submission
- e.preventDefault()
- const formdata = new FormData(inputForm)
- fetch(url,{
- method:"POST",
- body:formdata,
- }).then(
- response => response.text()
- ).catch(
- error => console.error(error)
- )
- })
|