A
acord
Hi,
I tried to replace a div section with a iframe page.
In Javascript, I use the following code to achieve the goal:
var par = window.parent.document;
// create new iframe
var new_iframe = par.createElement('iframe');
url = 'add_content.app?'+params;
new_iframe.src = url;
new_iframe.frameBorder = '0';
new_iframe.width = '836px;';
new_iframe.height = '797px;';
//par.getElementById('iframe').appendChild(new_iframe);
//par.getElementById('content3_upload').appendChild(new_iframe);
var oldChild = par.getElementById('rightContent');
par.getElementById('rightContent').replaceChild(new_iframe,
oldChild.firstChild);
is this correct? because I found out the old div section is shifted to
the bottom of the page in Firefox. In IE, althought it does replaced the
current div section with the new iframe page, but I loose all the style
setting and previous DIV setup. Eventhought I put back the style setting
in the <head> </head> section of the iframe page, it still not render
the page in a correct way.
What s the best way replace the current DIV section?
Thannks
A
I tried to replace a div section with a iframe page.
In Javascript, I use the following code to achieve the goal:
var par = window.parent.document;
// create new iframe
var new_iframe = par.createElement('iframe');
url = 'add_content.app?'+params;
new_iframe.src = url;
new_iframe.frameBorder = '0';
new_iframe.width = '836px;';
new_iframe.height = '797px;';
//par.getElementById('iframe').appendChild(new_iframe);
//par.getElementById('content3_upload').appendChild(new_iframe);
var oldChild = par.getElementById('rightContent');
par.getElementById('rightContent').replaceChild(new_iframe,
oldChild.firstChild);
is this correct? because I found out the old div section is shifted to
the bottom of the page in Firefox. In IE, althought it does replaced the
current div section with the new iframe page, but I loose all the style
setting and previous DIV setup. Eventhought I put back the style setting
in the <head> </head> section of the iframe page, it still not render
the page in a correct way.
What s the best way replace the current DIV section?
Thannks
A