Results 1 to 3 of 3

Thread: Target=“_blank” vs

  1. #1
    Join Date
    Nov 2009
    Thanked 0 Times in 0 Posts

    Default Target=“_blank” vs

    I'm working on an application where users enter some input and they shouldn't leave the page when clicking on share links, e.g. a Facebook share link:
    <a href="">Share on Facebook</a>
    I know it's very common to use popup windows for such links. But does it have any advantage over a simple target="_blank" attribute? How do you compare the two methods and which is the right practice in such cases?

  2. #2
    Join Date
    Nov 2006
    chertsey, a small town 25 miles south west of london, england.
    Thanked 113 Times in 111 Posts


    Hi there Rain Lover,

    The target="blank" attribute has two advantages that come to mind...

    1. it does not require javascript
    2. it is not affected by pop-up blockers


  3. #3
    Join Date
    Mar 2005
    Thanked 3,190 Times in 3,154 Posts
    Blog Entries


    Popup blockers will block target="_blank" if the settings are strict enough. In fact, since will not usually be blocked if activated by a click action of the user (it will be blocked, again, if the settings are strict enough), these are about equivalent in that department. It's correct that target doesn't require javascript. Using allows (though does not require) one to use specifications. Although many of these are now ignored by most browsers as a matter of course, most still allow specification of width, height, top and left, and sometimes a few other things. These can be handy.

    However, in most cases it's overall bad form to open a new window. The user can do this his/her self, if desired. If the new content is such that it should not change the root page in the browser, it can often be introduced via AJAX, and/or a popup div, and/or an iframe. If it is from another site, best to leave that (decision as to where to open it) to the user. Otherwise you might inadvertently violate TOS and/or copyright.
    - John

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Rain Lover (07-02-2014)

Similar Threads

  1. Flexi Slide Show: target=_blank or _new
    By carolinawebdesign in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 09-08-2010, 09:21 AM
  2. 'small' window target="_blank"
    By northyukon in forum JavaScript
    Replies: 2
    Last Post: 02-06-2010, 09:55 PM
  3. Carousel II (2) Open Target in SAME window
    By npimpfellow in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 05-01-2009, 03:36 AM
  4. target _blank does not function. Why?
    By anne oosterhaven in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 01-17-2005, 09:11 PM


Posting Permissions

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