replacing a DIV section with iframe page

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top