document.domain property

Due to raising security concerns on the web as a whole the Internet Explorer Security
has been tightened in Internet Explorer 4.0. The following is a mock-up of how one would
create a web page so that it can "talk" (access the object model) to a frame or inline-frame and vice-versa

For Example: If this page were being loaded from http://www.microsoft.com
and we wished to access the HTML of the IFRAME with parent.frames(0).document.all.myBody.innerHTML
and the IFRAME contents were coming from http://sbn.microsoft.com.

You must do two things.

  1. Set the document.domain property to the domain in common to both in this case document.domain should be set to "microsoft.com"
  2. The document.domain property MUST ALSO be set to "microsoft.com" in the FRAME or IFRAME that is on the Main page

NOTE: This specific example will not work since these pages are not residing on the servers that the document.domain property is set to.


This is how the script in the parent frame should be: