Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Oct 2002
    Location
    Sheffield, Yorkshire, England
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Referring to a frame

    Using vbscript what is the syntax to refer to an element in a different frame. In the same frame I would use:
    document.all.idname.innerhtml

    TIA
    Graham

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Referring to a frame

    There is an implicit window object before document, so if you have a frameset of two frames named left and right, for example, IE's document object model lets you do this to insert the contents of the body tag of the document in the right frame into the left frame (this code is in the left frame):

    <script language="vbscript">
    document.write self.parent.right.document.body.innertext
    </script>

    It's ugly, but it seems to work. Does that help?

  3. #3
    Star Lounger
    Join Date
    Oct 2002
    Location
    Sheffield, Yorkshire, England
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Referring to a frame

    Thanks for the pointer.
    self.parent.frames(0).document.all.idname.innerhtm l does the trick.

    Graham

Posting Permissions

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