Avatar of d2kagw
d2kagw
 asked on

Firefox draws iframe inside iframe

Hi There,

I have this strange problem on my hands.
Theres this script that I have writen, and at the moment, it works fine in IE, but I need to make it work for FireFox too...
Now what happens is when the user clicks on a link within a iFrame, the iframes content is changed[just info from a JS array] by a javascript function sitting in the parent...

In IE this works fine, the content is cleared and re-writen with no errors, however in FireFox, the whole page is reloaded in the iframe, so theres a iframe in the iframe with the initial content...

this is a snippet of the code im using:

            this.navArea.open( );
            this.navArea.write( this.writer );
            this.navArea.close( );

where this.navArea = getElementById(myiFrame) [registering this A-OK]
And this.writer is the content to be writen...

now, I have no objections to having to write two versions of this code if necessary [a IE and FireFox version] and I am also aware that generally the .write() function causes a page refresh, but its just strange that it reloads the entire page within itself, where the iframe doesn't start with a src at all... its all dynamically generated once the page has loaded....

Any Ideas?
JavaScript

Avatar of undefined
Last Comment
Zvonko

8/22/2022 - Mon
d2kagw

ASKER
Oh, and I wouldn't mind using innerHTML to write the content, only, for some reason I can't get it to write to the iFrame...
Zvonko

The upper shown snippet cannot work as is, because the write() method is bound to document.write()
Can we see the complette page source?
Or is your page accessible online?
d2kagw

ASKER
the page is accessible online.. theres to much code to post...

http://salinger.dynalias.org:7470/_runway/development/cms_dev/navigation_js.php
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER CERTIFIED SOLUTION
Zvonko

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Zvonko

Also to simplify your parent page I would write your body tag like this:

<body onLoad="(myNavEdit=new cms_Navigation ( navInfo, 'cms_navDisplay', 'myNavEdit' )).drawLevel('0.0.2.0')">

d2kagw

ASKER
Excelent, the return false works great...
Zvonko

fine :-)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.