Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Jul 2002
    Location
    ...somewhere out there in the ether...
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding Target to Meta Refresh

    Is it possible to add a target to the Meta command below? The syntax eludes me...

    <meta http-equiv="refresh" content="0;URL=Alt/index.html">

    Javascript is not an option in this circumstance.

    ...feeling like I'm missing the forest for the trees today...
    TIA!

  • #2
    umm
    umm is offline
    Regular Coder
    Join Date
    Sep 2002
    Location
    Antipodes
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Unfortunately, i don't think the target attribute can be used with the meta refresh.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    By "Javascript is not an option" do you mean 'no way', 'nohow', 'nat ganna' dah it!'....otherwise:

    <meta http-equiv="refresh" content="0;URL=javascript:open('Alt/index.html')">

  • #4
    New Coder
    Join Date
    Aug 2002
    Location
    England, United Kingdom
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If this is not possible then....

    I have searched for a similar answer, it seems this question has not been asked for nearly 3 years.

    My question is this, I was looking to force a page to load out of the target frame as I am using a Flash menu which only allows one target for all of it's links. 4 of my 7 links load into my 'main' frame in the frameset (works nicely) and 1 is a 'mailto' (making the target irrelevant), but 2 links need to load into the _top frame, so I thought maybe a re-directing page with META-REFRESH would work.

    Reading this post seems it won't, so......

    Is there a script to force a page to load into the _top frame if it detects it is loaded into a frame? (Thought occurs......I could change the Flash menu's links not to load into a frame and use a script to view the 4 linked frames in their parent frameset? ) (No I couldn't, it loads into the navbar frame)

    Think this may be untidy and the other way hasn't been done? Yet.......
    Last edited by winactive; 06-05-2005 at 11:45 AM.

  • #5
    Regular Coder
    Join Date
    May 2005
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    By the way, meta refresh can be disabled, so including an alternative link in the document is recommended.
    Thanks in advance!

  • #6
    New Coder
    Join Date
    Aug 2002
    Location
    England, United Kingdom
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by enumerator
    By the way, meta refresh can be disabled, so including an alternative link in the document is recommended.
    That, I can manage. Isn't it strange how I can't do the same from a meta tag or using javascript?

    (If it helps, the 'external' site I'm linking to resides on the same server space, just in a different folder, one in the same tier, the other in the parent directory.)

    I would have included the 'click here if you are not re-directed' type of link.

  • #7
    Regular Coder
    Join Date
    May 2005
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, it's probably possible, but scripting depends on specifics, and you haven't posted any code (and this is the wrong forum).
    Thanks in advance!

  • #8
    New Coder
    Join Date
    Aug 2002
    Location
    England, United Kingdom
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't have any code, I'm trying to write it!

    How do I make a page loading in the 'main' frame (or any other frame, name is irrelevant) force to load in the _top frame automatically, without using a HTML link;

    (i.e. <a href=blah.htm target=_top>Go to blah</a>)

    This is why I had my hopes pinned on META-REFRESH as it supports automatic linking, but without the target option, I'm sunk.

    Maybe a moderator would care to move my thread to Javascript, but I tried searching for an answer and couldn't find one.

  • #9
    New Coder
    Join Date
    Aug 2002
    Location
    England, United Kingdom
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Got it!

    Anyone in the same pickle as me can use the usual meta-refresh tag but make sure the target page includes the following script to force it into the _top frame;

    <SCRIPT LANGUAGE="javascript">
    <!--
    if (top.location != location) top.location.href = location.href;
    //---> </SCRIPT>

    Of course, using a re-directing page first is useful as enumerator suggests and the link can include the usual HTML frame targeting syntax.

    Thanks.


  •  

    Posting Permissions

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