diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2024-09-19 22:09:20 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2024-09-19 22:09:20 +0200 |
commit | eec01c9b72feff9533477014881b982124ca7b6d (patch) | |
tree | 084586316e04f01f48b479de0cb41113639ac8d5 /static/main.js | |
download | odr-dabmux-gui-eec01c9b72feff9533477014881b982124ca7b6d.tar.gz odr-dabmux-gui-eec01c9b72feff9533477014881b982124ca7b6d.tar.bz2 odr-dabmux-gui-eec01c9b72feff9533477014881b982124ca7b6d.zip |
Create project
Diffstat (limited to 'static/main.js')
-rw-r--r-- | static/main.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/static/main.js b/static/main.js new file mode 100644 index 0000000..8e8b87c --- /dev/null +++ b/static/main.js @@ -0,0 +1,16 @@ + +async function post(url, data) { + const params = { + method: "POST", + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(data), + }; + + let response = await fetch(url, params); + if (!response.ok) { + const text = await response.text(); + alert(`Error Sending: ${response.statusText} ${text}`); + } +} |