[wd_asp elements=’search’ ratio=’100%’ id=1]

Make Iframe with Javascript

17th July 2014

Javascript

javascript category codehaven





GO!


To make it append to a div called container (id) use this

function makeFrame() {
ifrm = document.createElement("IFRAME");
ifrm.setAttribute("src", "http://aq.gthex.co.uk:10000/");
ifrm.style.width = 100+"%";
ifrm.style.height = 100+"%";
// document.body.appendChild(ifrm);
var objTo = document.getElementById('container')
objTo.appendChild(ifrm);
}

And here we have an iframe that can switch between replacing the contents each time





GO!

GO!


If you need to remove iframe border then

ifrm.frameBorder = 0;