SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2004
    Location
    Sweden
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Retrieving URL from another frame

    Hey ppl, anybody knows if there is a way you can write a script that determines the URL of another frame than its own?

  2. #2
    SitePoint Member cyber.saurus's Avatar
    Join Date
    Jun 2004
    Location
    Belgium
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    parent.location
    parent.frames[0].location (1st frame)
    parent.frames[1].location (2nd frame)
    parent.otherFramename.location (named frame in same frameset)


    Hope this will do.

  3. #3
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If that doesn't work, try this one:

    Code:
    <script language="javascript">
    // The name of the other frame
      var frameName = 'test';
    // Assign the frame to a variable
      var frameFull = document.getElementById(frameName);
    // Get the URL
       var frameURL = frameFull.src;
    </script>
    Now the location of the frame "test" should be contained in the variabled "frameURL".
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches


Bookmarks

Posting Permissions

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