faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 13 people (38%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

Coming up through an IFRAME to parent, error when attempting to write a new IFRAME

Apr 6th, 2008 19:55
ha mo, Mark Griffin,


I am trying to come up through an IFRAME to access an item on the 
parent document so that I can write another IFRAME and position it in 
the correct place.
When I try this however I get an error that the document cannot be 
found.
My code for writing the new IFRAME:
var posi = parent.document.body.clientWidth/2-150;
function addIframe () {
  if (document.all)
    parent.document.body.insertAdjacentHTML('beforeEnd',
      '<iframe style="position:relative; top:-850px; left:'+ posi +'px; 
width: 468px; height: 360; zindex:0;" id=thisIframeName 
src="myiframecontents.html"></iframe>');
}
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com