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 12 of 12
  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Location
    Los Angeles, CA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting a link to open a new window

    can some one please tell me what the code looks like to make a web page link open a new window to another web page.

  • #2
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    404
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <a href="link/to/window" target="_top">link text</a>
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #3
    New to the CF scene
    Join Date
    Jan 2003
    Location
    Los Angeles, CA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the font of the text doesn't show up. what am i doing wrong?

    sample of my code: <a href="http://www.hostboard.com/cgi-bin/ultimatebb.cgi?ubb=forum&f=4190"target="><font face="Helvetica" size="-1"><span style="font-size:12">Message Baords</span></font></a>

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Spaces...

    Try inserting some spaces to separate the different attributes, your target isn't set, and why do you use both the (deprecated) font element and an inline style? Try:
    Code:
    <a href="http://www.hostboard.com/cgi-bin/ultimatebb.cgi?ubb=forum&f=4190"
       target="_blank">
    <span style="font-family: helvetica, sans-serif; font-size: 12px">
    Message Boards
    </span>
    </a>
    Update: i followed along like a tame sheep, but the target should have been _blank; _top refers to the top-level window. By the way: any name that doesn't exist yet results in a new window, so provided that no window with the name "foobar" exists,
    Code:
    <a href="foo.html" target="foobar">A new window</a>
    opens a new window by the name of "foobar" (if it does exist, it opens the referred page in that window).
    Oh, and I did some checking: the HTML 4.01 Recommendation doesn't say a word about the four general names, only about the use of target to address frames, and W3Schools indicates that the target attribute is not in the strict DTD.
    What else do we use to open a new window then?!!
    Last edited by ronaldb66; 01-24-2003 at 08:23 AM.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    mr. ...
    /me would just a use® the ...target=_new ... to get just a new® window...n' leave yourrr 'clicked from here page' still in the background...


    feyd...
    ifin' they just a used® yours??? twouldnt that just a replace® their 'current' clicked from here page??? aka it twouldnt open just a new® browser???


    ron...
    "quote...What else do we use to open a new window then?!!...endquote"
    /me just a uses® the ...target=_new

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Ames, IA, USA
    Posts
    373
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The loss of target is a mistake, I think.

    The only workarounds I can think of: Use an onclick event to open a new window (which fails badly if javascript is not enabled), or add a message telling users to hold down the shift key if using IE or the control key if using Mozilla/Netscape while activating the link (which opens the file in a new window).

    I dislike both.
    Need more emoticons?
    Visit Catman's Private Stock

  • #7
    New to the CF scene
    Join Date
    Jan 2003
    Location
    Los Angeles, CA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx for all the help guys. i'm soooo glad i found this place.

  • #8
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    404
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey, I was up late and had a drastic dip in my caffeine level, so what if I was thinking blank and typed top...so shoot me people!
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Originally posted by Feyd
    1...Hey, I was up late
    2...had a drastic dip in my caffeine level,
    3...so what if I was thinking blank and typed top...
    4...so shoot me people! :thumbsup:
    feyd...
    1...just a excuses/excuses/excuses® hehehe...
    2...just a rotflmao®!!!!!! wheeere is 'dom' whennn /me neeeds himmm...more lol'in...geeezzz.../me just a bout® spewed her [_]? readin' thattt from you!!! youuu??? caffine??? n' youuu used to 'request' /me n' dom nottt drink it??? lol...
    3...thattts ok.../me totallly understands...since you dooo just a remember® /me isnt programmed to think either...:O)))
    4...nahhh /me will just a hugs® ya instead...:O)))

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    _new?

    Justame,

    the four general target values are _blank, _parent, _self and _top; _new isn't and will only open a new window named "_new" provided that it doesn't exist yet, falling under the "any name" cases.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #11
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ron...
    /me just a uses® ..._new ...alll the time...aka...
    <a href="whatever.html" target="_new">just a click® here n' whatever.html opens</a>

  • #12
    Regular Coder
    Join Date
    Jun 2002
    Location
    Ames, IA, USA
    Posts
    373
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A sidenote: I was looking through the XHTML 2.0 specs the other day and noticed that target has been brought back. Let's hope that when they make 2.0 official, that remains true.
    Need more emoticons?
    Visit Catman's Private Stock


  •  

    Posting Permissions

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