SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    This may sound silly...

    Is it possible to add magic target window such as _blank directly to a link without using the target attribute of the area tag?

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,097
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    Nope, you either need target="_blank" or onclick="window.open(this.href); return false;" for that. Just the URL ain't gonna cut it.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,872
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    You can do it for links in the web pages that you display in your own browser by adjusting the browser settings to tell it where you want links to open.

    If you are using Firefox then there's an extension (I can't remember the name of it at the moment) that gives you full control so that you can have different types of link destinations open in different ways (such as having all relative links open in the same tab and all absolute ones open in a new tab.


    From the web page itself you can only make recommendations as to where the page should open which will override some people's ability to choose for themselves. For those who know how to configure their browser properly your recommendation will be ignored completely.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2011
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    scalio, thank you.

    and felgall: lol. who doesn't use tabbed browsing these days..? o_O


    I was just wondering because I'm trying to use a text file to define captions as links for images within Joomla as a non-scripted solution.
    Oh well I guess I'll just write it up as I expected.
    I was next to positive such a solution didn't exist but why not check? :-P
    Maybe i'll make my own magic window targeting system via hashes

  5. #5
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by anarch View Post
    who doesn't use tabbed browsing these days..? o_O
    You'd be surprised how many hundreds of thousands of users don't have access to a tabbed browser, don't know how their tabbed browser works, or don't like them. Never safe to assume that "everyone" uses anything. I imagine there are some unfortunate souls out there still grinding away at the Intertubez with Netscape 4. I don't worry too much about them , but I do try to take into account the large number of folks who either use obsolete browsers such as IE6 either by choice or by the lack thereof.


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
  •