To properly load a Calendly popup script in Webflow after the page has fully loaded, you'll need to delay its execution until the window.onload event or use DOMContentLoaded depending on script placement.
window.onload
window.onload to execute only after the full page (including assets) has loaded.
Example (inside Before </body> tag area):
<script>
window.onload = function() {
Calendly.initPopupWidget({url: 'https://calendly.com/your-link'});
};
</script>
'https://calendly.com/your-link' with your actual Calendly scheduling link.
<script src="https://assets.calendly.com/assets/external/widget.js" type="text/javascript" async></script>
calendly-btn).
<script>
window.onload = function() {
document.getElementById("calendly-btn").addEventListener("click", function() {
Calendly.initPopupWidget({ url: 'https://calendly.com/your-link' });
return false;
});
};
</script>
To load a Calendly popup script only after the page has fully loaded, wrap the Calendly.initPopupWidget() inside a window.onload function. Ensure the Calendly base script (widget.js) is included and loaded asynchronously. Optionally, trigger it on button click for better user control.