Accessing Frames

Discussion in 'Javascript' started by J. Moreno, Jul 29, 2006.

  1. J. Moreno

    J. Moreno Guest

    Hi,

    I'm looking at some old code, and am having a problem with IE having
    changed how accesses an object:

    pages = window.parent.frames.item(1).document.all("position");

    This works under Win200 and 6.0.2800.1106.

    But not under WinXp and 6.0.2900.2180.

    Does anyone know what IE might be looking for?

    Thanks,

    --
    J. Moreno
     
    J. Moreno, Jul 29, 2006
    #1
    1. Advertising

  2. J. Moreno

    Randy Webb Guest

    J. Moreno said the following on 7/28/2006 8:30 PM:
    > Hi,
    >
    > I'm looking at some old code, and am having a problem with IE having
    > changed how accesses an object:
    >
    > pages = window.parent.frames.item(1).document.all("position");


    What does item(1) refer to?
    What is "position"?

    > This works under Win200 and 6.0.2800.1106.
    >
    > But not under WinXp and 6.0.2900.2180.
    >
    > Does anyone know what IE might be looking for?


    Not even MS is sure what IE might be looking for about 90% of the time.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Jul 29, 2006
    #2
    1. Advertising

  3. J. Moreno

    J. Moreno Guest

    Randy Webb <> wrote:
    > J. Moreno said the following on 7/28/2006 8:30 PM:
    > > Hi,
    > >
    > > I'm looking at some old code, and am having a problem with IE having
    > > changed how accesses an object:
    > >
    > > pages = window.parent.frames.item(1).document.all("position");

    >
    > What does item(1) refer to?


    An individual frame. In FF window.parent.frame[1] works.

    > What is "position"?


    An ID (yeah, I know, bad idea to have more than one element with the same
    ID, I'll fix that next).

    > > This works under Win200 and 6.0.2800.1106.
    > >
    > > But not under WinXp and 6.0.2900.2180.
    > >
    > > Does anyone know what IE might be looking for?

    >
    > Not even MS is sure what IE might be looking for about 90% of the time.


    Heh. But I need to find out what it wants this time...

    --
    J. Moreno
     
    J. Moreno, Jul 31, 2006
    #3
  4. J. Moreno wrote:
    > pages = window.parent.frames.item(1).document.all("position");
    >
    > This works under Win200 and 6.0.2800.1106.
    > But not under WinXp and 6.0.2900.2180.


    Didja already try debugging to see what fails? Like an alert and
    removing the ending object each time until it works?

    alert(window.parent.frames) etc.

    What error did you get, btw? No permission or ?? W2K and XP seem
    to sometimes have different security models.

    Also, personally, I'd name the frames so you don't have to do the
    frames.item(1) thingie. Ooops, never mind, I forgot that you said it
    was old code.

    Luck! - Kev
     
    Kevin Darling, Jul 31, 2006
    #4
  5. J. Moreno

    Randy Webb Guest

    J. Moreno said the following on 7/31/2006 12:08 PM:
    > Randy Webb <> wrote:
    >> J. Moreno said the following on 7/28/2006 8:30 PM:
    >>> Hi,
    >>>
    >>> I'm looking at some old code, and am having a problem with IE having
    >>> changed how accesses an object:
    >>>
    >>> pages = window.parent.frames.item(1).document.all("position");

    >> What does item(1) refer to?

    >
    > An individual frame. In FF window.parent.frame[1] works.


    IE only code, gotta love it.

    >> What is "position"?

    >
    > An ID (yeah, I know, bad idea to have more than one element with the same
    > ID, I'll fix that next).


    It's not just a "bad idea" as it is invalid HTML code and when presented
    with invalid HTML anything goes.

    >>> This works under Win200 and 6.0.2800.1106.
    >>>
    >>> But not under WinXp and 6.0.2900.2180.
    >>>
    >>> Does anyone know what IE might be looking for?

    >> Not even MS is sure what IE might be looking for about 90% of the time.

    >
    > Heh. But I need to find out what it wants this time...


    Start with validating the HTML to make sure it isn't a multiple ID issue
    as IE may make a collection of same-ID'ed elements (I don't remember to
    be honest). Then, start debugging with alerts and find out what is
    causing the error.


    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Jul 31, 2006
    #5
  6. J. Moreno

    J. Moreno Guest

    "Kevin Darling" <> wrote:
    > J. Moreno wrote:
    > > pages = window.parent.frames.item(1).document.all("position");
    > >
    > > This works under Win200 and 6.0.2800.1106.
    > > But not under WinXp and 6.0.2900.2180.

    >
    > Didja already try debugging to see what fails? Like an alert and
    > removing the ending object each time until it works?
    >
    > alert(window.parent.frames) etc.
    >
    > What error did you get, btw? No permission or ?? W2K and XP seem
    > to sometimes have different security models.


    Yeah, it was a security problem -- MS's silly "Mark of the Web" wasn't on
    the main page.

    > Also, personally, I'd name the frames so you don't have to do the
    > frames.item(1) thingie. Ooops, never mind, I forgot that you said it
    > was old code.


    The frames were already named. Which means I can use
    window.parent.frames.frameName, I just checked and IE recognizes it (both
    on my development machine and when working).

    --
    J. Moreno
     
    J. Moreno, Jul 31, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Powerslave2112

    From Frames to no frames?

    Powerslave2112, Jan 20, 2004, in forum: HTML
    Replies:
    2
    Views:
    627
    brucie
    Jan 20, 2004
  2. Philip
    Replies:
    3
    Views:
    999
    Karl Groves
    Jun 28, 2004
  3. Ale

    Frames or not Frames...

    Ale, Aug 3, 2005, in forum: HTML
    Replies:
    17
    Views:
    988
    Adrienne
    Aug 5, 2005
  4. Replies:
    1
    Views:
    1,027
    dorayme
    Feb 10, 2006
  5. Replies:
    0
    Views:
    1,216
Loading...

Share This Page