Iframe within Desktop template window

Get help with using Metro 4 components
Post Reply
Sparky98
Posts: 1
Joined: Tue Aug 20, 2019 4:02 am
Status: Offline

Iframe within Desktop template window

Post by Sparky98 » Tue Aug 20, 2019 5:48 am

Hi, wondering if anyone can help.

Im trying to build a window using the desktop style template using the code below.
The problem i keep running into is that it just wont load the window when selected in the 'start menu'.
I have set the url to google, but will be using an internal ip once resolved.
Any help much appreciated.

function createWindow(){
var index = Metro.utils.random(0, 3);
var w = Desktop.createWindow({
resizeable: true,
draggable: true,
width: 500,
icon: "<span class='mif-"+w_icons[index]+"'></span>",
title: "dvr",
content: "<script type="text/javascript">
function prepareFrame() {
var ifrm = document.createElement("iframe");
ifrm.setAttribute("src", "http://google.com/");
document.body.appendChild(ifrm);
}
</script>"
});

Post Reply