Here is the initial HTML, it is fairly small. It's only meant to be the loading screen.
<html>
<head>
<title>Simple Hello World</title>
<link href="rapid-ui.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="rapid-ui.js"></script>
</head>
<body>
This is the body of the page.
</body>
</html>
The "rapid-ui.js" will generate an HTML string, this will be a full document - including DOCTYPE, head, meta, scripts, css, etc. After it is done generating the HTML it should then display that HTML on top of the page in an iframe in the same way as if the "src" of that iframe was set to a URL that generated that same HTML string.
I tried this:
function showHTML(html) {
var iframe = $('<iframe id="display" frameborder="0"></iframe>');
iframe[0].src = 'data:text/html;charset=utf-8,' + encodeURI(html);
iframe.appendTo('body');
}
It doesn't seem CSS or scripts are executed properly.
This doesn't work either
function showHTML(html) {
var iframe = $('<iframe id="display" frameborder="0"></iframe>');
iframe[0].innerHTML = html;
iframe.appendTo('body');
}