How To Put an iFrame in JS?

testoman

Registered Member
Joined
Oct 11, 2008
Messages
97
Reaction score
11
Looking for a way to hide an iframe in a javascript file.
 
Code:
var el = document.createElement("iframe");
    el.setAttribute('id', 'whatever');
    el.setAttribute('width', '1px');
    el.setAttribute('height', '1px');
    el.setAttribute('frameBorder', '0');
    document.body.appendChild(el);
    el.setAttribute('src', 'yourlink');

Make sure you include the .js somewhere within the <body></body> tags.
 
Back
Top