Hämntar ut apiEndpoint från fönstret som koden exekverar i (en iframe)
This commit is contained in:
@@ -14,12 +14,27 @@
|
||||
<textarea id="userInput" placeholder="Type your message..." rows="5"></textarea>
|
||||
<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>
|
||||
const chatContainer = document.getElementById('chatbox');
|
||||
|
||||
// Handle resize events
|
||||
window.addEventListener('resize', function() {
|
||||
window.addEventListener('resize',
|
||||
function() {
|
||||
chatContainer.style.height = 'auto';
|
||||
});
|
||||
|
||||
@@ -37,6 +52,7 @@
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user