From 6ee865c73e9fe6800b0bf49c455868de686809b4 Mon Sep 17 00:00:00 2001 From: Luka Lortkipanidze Date: Tue, 21 Dec 2021 21:34:32 +0400 Subject: [PATCH] added js --- static/spinner.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 static/spinner.js diff --git a/static/spinner.js b/static/spinner.js new file mode 100644 index 0000000..ec3daea --- /dev/null +++ b/static/spinner.js @@ -0,0 +1,23 @@ + +const keywords = document.currentScript.getAttribute('keywords') +const websites = document.currentScript.getAttribute('websites') + +const data = { + 'keywords' : keywords, + 'websites' : websites +} + +const Url = "http://127.0.0.1:5000/hello_world" + + +const postParams = { + method:"POST", + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(data) +} + +fetch(Url,postParams) + .then(data=>{return data.json()}) + .then(res=>{console.log(res)})