Trying to run this code:
$w.onReady(function () {
var iframe = document.createElement(‘iframe’);
var html = ‘’;
iframe.src = ‘data:text/html;charset=utf-8,’ + encodeURI(html);
$w(“#container2”).appendChild(iframe);
});
You can simply add a HTML component and add your code to it instead of creating an iframe using code.
Moreover, I recommend checking out the following articles:
Inside iframe will be code that need url-parameters from the main page. But this is impossible to get the parameters because of different domains. So, I think of inserting the code right into dom from wixCode. The key problem is that it is not possible to add code without iframe at all. Like my own script for example ().
Or is it possible?