Answers for "how to create an iframe without src"

CSS
1

js set iframe src

<script type="text/javascript">
function iframeDidLoad() {
    alert('Done');
}

function newSite() {
    var sites = ['http://getprismatic.com',
                 'http://gizmodo.com/',
                 'http://lifehacker.com/']

    document.getElementById('myIframe').src = sites[Math.floor(Math.random() * sites.length)];
}    
</script>
<input type="button" value="Change site" onClick="newSite()" />
<iframe id="myIframe" src="http://getprismatic.com/" onLoad="iframeDidLoad();"></iframe>
Posted by: Guest on February-01-2021
1

change iframe src

Do not use Inquisitive Iguana's answer! Notice the spelling of facebook in https://facobook.com. Visiting the webpage downloads malware onto your system

Message from my antivirus on my mac: "We've blocked the threat URL:Mal on http://dt.gnpe.com/ptmd from being downloaded."
Posted by: Guest on April-07-2021

Browse Popular Code Answers by Language