JSFiddle - React, Tailwind, and code Playground

by bgrins

JavaScript

//var iframe = document.createElement("iframe");
//iframe.src = "";//"http://fiddle.jshell.net/bgrins/bgJGb/show/";


var iframe = document.createElement('iframe');
iframe.setAttribute('sandbox', 'allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts');
iframe.setAttribute('frameBorder', '1');

document.body.appendChild(iframe);



/*
iframe.contentWindow.document.open();
iframe.contentWindow.document.write("<iframe src='about:blank'></iframe>");
iframe.contentWindow.document.close();
*/

document.onunload = function() {
        iframe.parentNode.removeChild(iframe);
    //document.body.removeChild(iframe);
    iframe.src = "about:blank";
};