Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Frustrating Firefox frames-in-frames

    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

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    I think window.frames is indexed by the 'name' attribute, rather than id, and that ie is being too forgiving.

  • #3
    New Coder
    Join Date
    Jul 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.howtocreate.co.uk/wrongWithIE/

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

  • #4
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by Zamees View Post
    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.

  • #5
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •