Web Analytics Made Easy -
StatCounter Firefox 0.8 document.frames - CodingForum

Announcement

Collapse
No announcement yet.

Firefox 0.8 document.frames

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Firefox 0.8 document.frames

    Normally in IE I would write
    alert(document.frames.length);
    and get the number of frames.

    this don't work in firefox so what should I write?

  • #2
    have you declared your frameset in the DTD?

    maybe you have to do this first, in order to get Firefox to recognise the command. maybe that's a feature of standards compliant browsers.

    only guessing tho
    *keep it simple (TM)

    Comment


    • #3
      my highly intelligent test code

      <html>
      <head>
      </head>
      <body onload="alert(document.frames.length);">
      <iframe></iframe>
      </body>

      Comment


      • #4
        <iframe></iframe>
        don't think iframes come under frameset rules. hence it's not part of the standard frames collection. if IE can detect it, it might just be that MS have added some capability.

        the tag's also deprecated, so best avoid really.

        don't really know definitively, as you've probably guessed lol
        *keep it simple (TM)

        Comment


        • #5
          iframes are part of the frames array ... but I don't think the array is a child of document - try window.frames
          "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

          Comment


          • #6
            britherbun ... think you're right. my mistake lol
            *keep it simple (TM)

            Comment


            • #7
              well ty that worked

              any know whats wrong with this non javascript line?
              <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

              Firefox gives :
              Error: syntax error
              Source File: MozTestCode.html
              Line: 1
              Source Code:
              <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


              And here is a js question

              IE gives the event object when functions are called from events,
              Firefox doesn't seem to give either an object named e or event, my question is doesn't it give one at all or what is it called?

              Comment


              • #8
                I don't know Firefox but I guess it behaves the same as Mozilla. Try passing the event to the function
                i.e.

                onclick="doClick(event)"

                function doClick(e){
                var evt = (e) ? e : event;
                }
                Glenn
                vBulletin Mods That Rock!

                Comment

                Working...
                X