diff --git a/dog-food-calculator-widget.js b/dog-food-calculator-widget.js index 0c4090e..e30b6ca 100644 --- a/dog-food-calculator-widget.js +++ b/dog-food-calculator-widget.js @@ -1546,13 +1546,16 @@ const iframeCode = document.querySelector('#iframeCode'); if (modal && widgetCode && iframeCode) { - const baseUrl = window.location.origin; + // Extract domain from current URL to build embed subdomain + const hostname = window.location.hostname; + const protocol = window.location.protocol; + const embedUrl = `${protocol}//embed.${hostname}`; const theme = this.theme !== 'system' ? ` data-theme="${this.theme}"` : ''; - widgetCode.textContent = ` + widgetCode.textContent = `
`; - iframeCode.textContent = `