You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<script type="text/javascript">(function (w,d) {var loader = function () {var s = d.createElement("script"), tag = d.getElementsByTagName("script")[0]; s.src="https://cdn.iubenda.com/iubenda.js"; tag.parentNode.insertBefore(s,tag);}; if(w.addEventListener){w.addEventListener("load", loader, false);}else if(w.attachEvent){w.attachEvent("onload", loader);}else{w.onload = loader;}})(window, document);</script>
I've added it to my component, like so: useScript('https://cdn.iubenda.com/iubenda.js')
It's working when reloading the page with STRG + F5, however, it does not load/replace the content when navigating between pages (e.g. navigating from page A which uses this component to page B which uses the same component)
ChatGPT suggested this ugly workaround but I was wondering if there is another solution?
📚 What are you trying to do?
I'm using iubenda to implement legal pages. The script looks for an element like this:
And replaces it with the content.
This is the original script: => https://cdn.iubenda.com/iubenda.js
This is how iubenda wants me to implement it:
I've added it to my component, like so:
useScript('https://cdn.iubenda.com/iubenda.js')
It's working when reloading the page with STRG + F5, however, it does not load/replace the content when navigating between pages (e.g. navigating from page A which uses this component to page B which uses the same component)
ChatGPT suggested this ugly workaround but I was wondering if there is another solution?
🔍 What have you tried?
onMounted
addEventListener('DOMContentLoaded')
ℹ️ Additional context
No response
The text was updated successfully, but these errors were encountered: