Update index.html
Browse files- index.html +21 -0
index.html
CHANGED
|
@@ -24,6 +24,27 @@ Current URL
|
|
| 24 |
</p>
|
| 25 |
|
| 26 |
<button onclick="getParameters()"> Get URL parameters </button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
<div id=output></div>
|
| 28 |
<script>
|
| 29 |
function getParameters() {
|
|
|
|
| 24 |
</p>
|
| 25 |
|
| 26 |
<button onclick="getParameters()"> Get URL parameters </button>
|
| 27 |
+
|
| 28 |
+
<button onclick="returnsUserMessage()">Send to python</button>
|
| 29 |
+
|
| 30 |
+
<script>
|
| 31 |
+
async function returnsUserMessage() {
|
| 32 |
+
var user_input = document.getElementById("input-chat").value;
|
| 33 |
+
var bot_reponse = await fetch('localhost/response',
|
| 34 |
+
{
|
| 35 |
+
method: 'POST',
|
| 36 |
+
headers: {
|
| 37 |
+
'Content-Type': 'application/json'
|
| 38 |
+
},
|
| 39 |
+
body: JSON.stringify({user_response: user_input})
|
| 40 |
+
});
|
| 41 |
+
// Then you need to present the bot response in your element
|
| 42 |
+
}
|
| 43 |
+
</script>
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
|
| 48 |
<div id=output></div>
|
| 49 |
<script>
|
| 50 |
function getParameters() {
|