Creating Iframe by changing innerHTML? Problems

Discussion in 'JavaScript' started by JezzaFromAUS, Apr 30, 2010.

  1. #1
    ok so just say i type this

    document.getElementById('divbox').innerHTML="<iframe src='thispage.html'></iframe>";

    In Chrome it does it as it should, creates a new iframe in the box and so forth.
    In IE and FireFox, it tends to simply redirect to the iframes src.

    How could i do this hehe. If it's any help i'm doing this through a link like this:

    <a href="javascript:document.getElementById('divbox').innerHTML='<iframe src=\'thispage.html\'></iframe>';">link</a>
     
    JezzaFromAUS, Apr 30, 2010 IP