B
BGMeshi
Hi,
The following javascript code (serving a main HTML page) dynamically
creates
IFRAME to contain other HTML page. Everyting works OK, however when I
am trying
to access the main HTML page elements from the child page by
window.parent.document... a javascript error is accepted.
Any Idea?
TIA Boris
function OpenLayer (HtmlName, atop, aleft, awidth, aheight, acolor)
{
DIVText = '<DIV ID = "LayerDiv"></DIV>';
var newDiv = document.createElement(DIVText);
FormID.insertBefore(newDiv);
document.all.LayerDiv.style.position = "absolute";
document.all.LayerDiv.style.top = atop;
document.all.LayerDiv.style.left = aleft;
document.all.LayerDiv.style.background = acolor;
document.all.LayerDiv.style.visibility = "visible";
OpenHTML (HtmlName, atop, aleft, awidth, aheight, acolor);
}
function OpenHTML (HtmlName, atop, aleft, awidth, aheight, acolor)
{
HTMLText = '<IFRAME '
HTMLText += 'SRC=' + HtmlName + ' ';
HTMLText += 'ID="IFrameLayer" ';
HTMLText += 'NAME="f1" ';
HTMLText += 'WIDTH="' + awidth + '" ';
HTMLText += 'HEIGHT="' + aheight + '" ';
HTMLText += 'BGCOLOR="' + acolor +'" ';
HTMLText += 'scrolling="NO" frameborder="NO"';
HTMLText += '><\/IFRAME>';
LayerDiv.insertAdjacentHTML('BeforeEnd', HTMLText);
}
The following javascript code (serving a main HTML page) dynamically
creates
IFRAME to contain other HTML page. Everyting works OK, however when I
am trying
to access the main HTML page elements from the child page by
window.parent.document... a javascript error is accepted.
Any Idea?
TIA Boris
function OpenLayer (HtmlName, atop, aleft, awidth, aheight, acolor)
{
DIVText = '<DIV ID = "LayerDiv"></DIV>';
var newDiv = document.createElement(DIVText);
FormID.insertBefore(newDiv);
document.all.LayerDiv.style.position = "absolute";
document.all.LayerDiv.style.top = atop;
document.all.LayerDiv.style.left = aleft;
document.all.LayerDiv.style.background = acolor;
document.all.LayerDiv.style.visibility = "visible";
OpenHTML (HtmlName, atop, aleft, awidth, aheight, acolor);
}
function OpenHTML (HtmlName, atop, aleft, awidth, aheight, acolor)
{
HTMLText = '<IFRAME '
HTMLText += 'SRC=' + HtmlName + ' ';
HTMLText += 'ID="IFrameLayer" ';
HTMLText += 'NAME="f1" ';
HTMLText += 'WIDTH="' + awidth + '" ';
HTMLText += 'HEIGHT="' + aheight + '" ';
HTMLText += 'BGCOLOR="' + acolor +'" ';
HTMLText += 'scrolling="NO" frameborder="NO"';
HTMLText += '><\/IFRAME>';
LayerDiv.insertAdjacentHTML('BeforeEnd', HTMLText);
}