32 lines
905 B
HTML
32 lines
905 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Text Input Example</title>
|
|
</head>
|
|
<body>
|
|
<textarea id="textInput" rows="10" cols="50"></textarea>
|
|
<textarea id="responseText" rows="30" cols="50"></textarea>
|
|
<br>
|
|
<button onclick="processText()">Process Text</button>
|
|
|
|
<script>
|
|
function processText() {
|
|
var textInput = document.getElementById("textInput").value;
|
|
fetch('http://localhost:5000/ask-claude', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'text/plain'
|
|
},
|
|
body: textInput
|
|
})
|
|
.then(response => response.text())
|
|
.then(text => {
|
|
var textInput = document.getElementById("responseText");
|
|
textInput.value = text;
|
|
})
|
|
.catch(error => console.error('Error:', error));
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|