I'm building a CSV Excel Importer Plugin in Toddle, where at first, I need to load one script that initializes the importer. The script is meant to be loaded as follows,
<script type="text/javascript" src="https://embed.impler.io/embed.umd.min.js" async></script>
So Added this code in the plugin Init_Impler event,
/**
* @param {Args} args
* @param {Ctx} ctx
*/
async function Init_Impler (args, ctx) {
const response = await import('https://embed.impler.io/embed.umd.min.js');
console.log(response);
if(window.impler) {
const importerId = "1";
window.impler.init(importerId);
window.impler.on('message', (data) => {
console.log(data);
}, importerId);
}
}
I called this method on page load, at first the CORS error was throwing which I resolved using the Chrome extension, but now some page-content error is throwing. The embed script is loading on the HTML page properly. Any Idea on how to fix this issue?