// embed-chatbot.js (function() { // Function to load a CSS file function loadCSS(href) { const link = document.createElement('link'); link.rel = 'stylesheet'; link.href = href; document.head.appendChild(link); } // Function to load a JS file function loadJS(src) { const script = document.createElement('script'); script.src = src; script.defer = true; document.body.appendChild(script); } // Function to inject the chatbot HTML function injectChatbot() { const chatbotHTML = ` Chat AI
Chatbot Icon close
send
`; // Append the chatbot HTML to the body of the host page document.body.insertAdjacentHTML('beforeend', chatbotHTML); } // Load the chatbot assets loadCSS('https://yumacollection.azurewebsites.net/static/style.css'); loadJS('https://yumacollection.azurewebsites.net/static/js/script.js'); // Inject the chatbot HTML into the host page injectChatbot(); })();