...

View Full Version : Frustrating Firefox frames-in-frames



Zamees
10-15-2006, 06:38 PM
doc = window.frames["message___Frame"].window.frames["eEditorArea"].document.getElementsByTagName("body")[0].innerHTML;

The above works great in IE, but Firefox gives me the error of window.frames.message___Frame has no properties.

Heres the link to the page, http://www.gamertagpics.com/testme.php

GJay
10-15-2006, 07:20 PM
I think window.frames is indexed by the 'name' attribute, rather than id, and that ie is being too forgiving.

SocoNaTromba
10-15-2006, 10:42 PM
http://www.howtocreate.co.uk/wrongWithIE/

just to mention that usually is IE's fault not Firefox.

Arty Effem
10-16-2006, 12:59 AM
doc = window.frames["message___Frame"].window.frames["eEditorArea"].document.getElementsByTagName("body")[0].innerHTML;

The above works great in IE, but Firefox gives me the error of window.frames.message___Frame has no properties.

Heres the link to the page, http://www.gamertagpics.com/testme.php
1) Your PHP isn't generating the iframe tag in FireFox, therefore it can't be addressed.
2) As mentioned already, the iframe should be referenced by its name attribute, which it hasn't been given.
3) The reference to document.all will fail in FireFox.

Zamees
10-17-2006, 04:07 AM
Using the fckeditor, it doesn't give a name to the Iframe, which appeared to be the issue. But I found a solution for this.

d = document;
f = d.frames ? d.frames['framename'] : d.getElementById('framename');
p = f.document || f.contentWindow.document;
g = p.frames ? p.frames['2ndframename'] : p.getElementById('2ndframename');
j = g.document || g.contentWindow.document;
doc = j.getElementsByTagName("body")[0].innerHTML;

That worked for all browsers. It seems the key part i was missing was "contentWindow" for Firefox and calling the frame element by its id.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum