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 13 of 13
  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    what is “_blank>”?

    I'm just learning programming, I want to know "_blank>" What is the meaning of this? As well as its usage is what?

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Can you give more context? I suspect it is the method of opening a link in a new window:

    <a href="blahblah.html" target="_blank">Open this link in a new window</a>

    (let the presentation vs behavior flaming commence :P)

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New Coder
    Join Date
    Jun 2013
    Posts
    34
    Thanks
    1
    Thanked 2 Times in 2 Posts
    It means that the link is going to be opened in a new window or tab. It is used in anker tag as mentioned by whizard.

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    It can also be used to submit a form into a new window

    Code:
    <form target="_blank">
    Also in opening a popup window:

    Code:
    window.open(url, "_blank");

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Note however that the target attribute was declared to be obsolete back in 1997 when it was decided that you ought to allow your visitors to chose where links should open.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #6
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,665
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    And it is being reintroduced in HTML 5 because people don’t care and ignorance is winning over reason.

  • #7
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Quote Originally Posted by VIPStephen
    people don’t care and ignorance is winning over reason.
    I hear you, brother!

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #8
    New Coder 4B/75/73/41/'s Avatar
    Join Date
    Nov 2008
    Posts
    56
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by VIPStephan View Post
    And it is being reintroduced in HTML 5 because people don’t care and ignorance is winning over reason.
    That's the reason why tyranny keeps growing stronger. It seems everyone is becoming a doormat.

  • #9
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by VIPStephan View Post
    And it is being reintroduced in HTML 5 because people don’t care and ignorance is winning over reason.
    No it is being reintroduced in HTML 5 simply to inform the browser authors that they have to allow for it in the code and not consider it an error.

    People who know how browsers work already know how to turn off such useless attributes as that and open links where they want and browsers are making it easier to do.

    Having target as a recognised attribute in HTML 5 means that browsers will be able to offer a browser setting that turns it off by default but which allows people to turn it on if they prefer to let web pages choose how their browser works. If it were not a recognised attribute then having a setting to allow or disallow it would make no sense and there are already lots of browser plugins for disabling it that rely on browsers recognising it so that it can be disabled.

    Remember - the HTML 5 specification defines what browsers have to allow - it is not specifying what web page authors should use - what should be used is always a small subset of what is allowed.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #10
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by whizard View Post
    Can you give more context? I suspect it is the method of opening a link in a new window:

    <a href="blahblah.html" target="_blank">Open this link in a new window</a>

    (let the presentation vs behavior flaming commence :P)

    HTH
    Dan
    Very nice you are,thank you!Now I konw how to use it!

  • #11
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by jerseyesway View Post
    Very nice you are,thank you!Now I konw how to use it!
    That's the way to annoy your visitors who don't know how to disable it. Best way to use it is to delete it from any page where you currently have it and not add it to any page where you don't have it. Let your visitors choose where to open links by right clicking the link and choosing from the three or five options offered there (instead of adding a target that effectively deletes a choice) or by configuring their browser to open links the way they want.

    For example my browser is configured to open new web site links in a new tab and to open links on the same site in the same tab regardless of any target attribute - which it is configured to ignore.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #12
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You'll gonna be using that if you want your user to automatically be directed to a new page when clicking the link. Otherwise, remove it if you don't need it. They can manually open it up in new tab anyways.

  • #13
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,639
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by eagletz101 View Post
    You'll gonna be using that if you want your user to automatically be directed to a new page when clicking the link.
    Only if they don't have their browser configured to work the way they want. The target will be ignored if they have their browser set to let them choose.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Tags for this Thread

    Posting Permissions

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