SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use JS to leave a page with frames?

    I can't seem to find a script like this but I have in the past. Does anyone know where I could find a script that, when a link on a page with frames is clicked, goes to the new page without keeping the frames?

    Thanks,
    Skourge

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You would use parent.location.href="somepage.html". An example would be:
    <A HREF="#" onClick="parent.location.href='somepage.html'">Click Me</A>

    Or you could create a function that could be used by multiple links like this:
    <SCRIPT LANGUAGE="JavaScript">
    function linkto(page)
    {
    parent.location.href=page
    }
    </SCRIPT>

    <A HREF="#" onClick="linkto('somepage.html')">Click Me</A>

    This would pass the URL to the function when the link was clicked on.

  3. #3
    SitePoint Member
    Join Date
    Aug 2002
    Location
    St. Louis, MO
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not entirely sure how to do it in Javascript, but can you just use:

    Code:
    <a href="http://www.whatever.com" target="top">Link Text</a>

    Sorry if I'm missing something...


    -GodOfHonk

  4. #4
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the responses. Ill give it a try.


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
  •