gk2410 commited on
Commit
5d67474
·
verified ·
1 Parent(s): 0460f16

Create script.js

Browse files
Files changed (1) hide show
  1. script.js +11 -0
script.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ async function solveDilemma() {
2
+ let dilemma = document.getElementById("dilemmaInput").value;
3
+ let response = await fetch("/solve", {
4
+ method: "POST",
5
+ headers: { "Content-Type": "application/json" },
6
+ body: JSON.stringify({ dilemma: dilemma })
7
+ });
8
+
9
+ let data = await response.json();
10
+ document.getElementById("solution").innerText = data.solution;
11
+ }