Hämntar ut apiEndpoint från fönstret som koden exekverar i (en iframe)
This commit is contained in:
@@ -14,13 +14,28 @@
|
|||||||
<textarea id="userInput" placeholder="Type your message..." rows="5"></textarea>
|
<textarea id="userInput" placeholder="Type your message..." rows="5"></textarea>
|
||||||
<button onclick="sendMessage()">Send</button>
|
<button onclick="sendMessage()">Send</button>
|
||||||
|
|
||||||
|
<!-- Get the apiEndpoint -->
|
||||||
|
<script>
|
||||||
|
const apiEndpoint = window.apiEndpoint;
|
||||||
|
// Debugging – log messages
|
||||||
|
// if (apiEndpoint) {
|
||||||
|
// console.log("client.html - apiEndpoint: ", apiEndpoint);
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// console.log("client.html - cannot find apiEndpoint");
|
||||||
|
// }
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Get the javascript handling communication with the backene -->
|
||||||
<script src="/js/frontend.js"></script>
|
<script src="/js/frontend.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const chatContainer = document.getElementById('chatbox');
|
const chatContainer = document.getElementById('chatbox');
|
||||||
|
|
||||||
// Handle resize events
|
// Handle resize events
|
||||||
window.addEventListener('resize', function() {
|
window.addEventListener('resize',
|
||||||
chatContainer.style.height = 'auto';
|
function() {
|
||||||
|
chatContainer.style.height = 'auto';
|
||||||
});
|
});
|
||||||
|
|
||||||
const userInputElement = document.getElementById('userInput');
|
const userInputElement = document.getElementById('userInput');
|
||||||
@@ -37,6 +52,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user