Link to home
Start Free TrialLog in
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?
Avatar of d2kagw
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...
Avatar of 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?
Avatar of 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
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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')">

Avatar of d2kagw

ASKER

Excelent, the return false works great...
fine :-)