I want to implement the following code to improve my site performance and try to fire the script after scroll and wait 1 second.
<script type="text/javascript">
window.addEventListener('scroll',() =>
setTimeout(() => {
//Delay calendly
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>
}, 1000);
);
</script>
I have this calendly script that I want to delay. The thing is I can't include the script inside another script, so, are there any way to make it?
Thanks!