Iframe in rect vs iframe in HTML Widget


(steve) #1

Is there any advantage to using an iframe in an HTML Widget vs using a rect with inner html for an iFrame?

And, how do I change the src of the iframe with an HTML Widget using javascript? Just change the inner html? Or do I change the src property.

Thanks.


(Hans-Gerd Claßen) #2

create and append an Iframe to an element via script:

var ifrm = document.createElement("iframe");
with(ifrm){
setAttribute("src", 'yourUrl');
setAttribute("scrolling", "yes");
setAttribute("marginwidth", "0");
setAttribute("marginheight", "0");
setAttribute("frameborder", "0");
setAttribute("vspace", "0");
setAttribute("hspace", "0");
style.width = "100%";
style.height = "100%";
style.paddingLeft = "0%";
style.paddingRight = "0%";
}
hypeDocument.getElementById('yourElement').appendChild(ifrm);

a widget is supported by the UI of hype … which should be the only difference


(Mark Hunte) #3

Also.

Rect with inner iframe - produces a single iframe


widget with inner iframe - produces a double iframe


widget with specific url - produces a single iframe