SitePoint Sponsor

User Tag List

Page 1 of 4 1234 LastLast
Results 1 to 25 of 83
  1. #1
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs down target="_blank" not working

    I have been using tripod free web hosting site for more than a year now.

    Recently, they changed the codes in the banner creation.

    All my hyperlinks with the code target="_blank" do not open in a new browser window...instead, the same window is used...this is irritating...it means my having to use the back button everytime I want to goback to my webpage.

    How is it they are able to override my code?

  2. #2
    SitePoint Wizard maartenvr's Avatar
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    1,676
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you show us the page?
    Maarten

  3. #3
    Are You There? KDesigns's Avatar
    Join Date
    Oct 2003
    Location
    Your Monitor
    Posts
    1,147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That doesn't make much sense unless they have a script that disallows new pages being opened... this would make sure that their frame was always present.

    Why don't you post a link to your site so we can have a look at the code.
    ChooseDaily.com - Follow on Twitter
    Top Resources for Web Designers and Developers Every Day!

  4. #4
    With More ! for your $ maxor's Avatar
    Join Date
    Feb 2004
    Location
    Scottsdale, Arizona
    Posts
    909
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:


    You shouldn't really be using the target attribute anyhow

  5. #5
    SitePoint Wizard maartenvr's Avatar
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    1,676
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by maxor
    You shouldn't really be using the target attribute anyhow
    Why not?
    Maarten

  6. #6
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by msiruit
    Why not?
    It's been depracated.

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by msiruit
    Why not?
    The target attribute is really to target other frames, not spawn new windows. That's a choice best left up to the user, and Javascript's window.open() can also open new windows nicely.

  8. #8
    Are You There? KDesigns's Avatar
    Join Date
    Oct 2003
    Location
    Your Monitor
    Posts
    1,147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What alternative is there other than Javascript? Isn't opening a new window a pretty needed attribute (external links, etc).
    ChooseDaily.com - Follow on Twitter
    Top Resources for Web Designers and Developers Every Day!

  9. #9
    Are You There? KDesigns's Avatar
    Join Date
    Oct 2003
    Location
    Your Monitor
    Posts
    1,147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess I'm replying to myself

    Here's an XHTML alternative that I just came across:

    Old code:

    Code:
    <a target="_blank" href="http://some_other_site.com">Some Other site</a>
    XHTML Alternative:

    Code:
    <a onclick="window.open(this.href,'_blank');return false;" href="http://some_other_site.com">Some Other Site</a>
    ChooseDaily.com - Follow on Twitter
    Top Resources for Web Designers and Developers Every Day!

  10. #10
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,449
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I think this article explains the proper way to do this with javascript and xhtml:

    New-Window Links in a Standards-Compliant World

  11. #11
    With More ! for your $ maxor's Avatar
    Join Date
    Feb 2004
    Location
    Scottsdale, Arizona
    Posts
    909
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even if it's an external link, you shouldn't open new windows if people don't want them to be opened. If they want to stick around on your site they'll right-click and choose to open it in a new window.

    That's the logic at least.

  12. #12
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Always try to inform the user with text or a title attribute if you plan to spawn a window on an anchor element.

  13. #13
    SitePoint Wizard maartenvr's Avatar
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    1,676
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it is quite normal to have links to external websites open in a new window without a warning...!

    Also, I have found that JavaScript that opens links in new windows are sometimes blocked by pop-up blockers....
    Maarten

  14. #14
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xhtmlcoder
    Always try to inform the user with text or a title attribute if you plan to spawn a window on an anchor element.
    Or use some kind of 'new window' mini icon.
    It can be done easily enough using css to add padding and an offset background image for external links with either a specific class or within a certain container div.

    I wouldn't consider the title attribute to be enough on its own as most people don't tend to linger on links long enough and don't always read the info in the tooltip.

    Similarly, most newbies aren't even aware of the options available in right-click, so although they may actually prefer to have external links open in new windows, it can't be relied upon that the user already knows how to get what they want from their browsing experience.


    I feel the best option is to implement a javascript target switcher to allow users to choose whether external links open in new windows or not.
    I adapted the 'new windows in a compliant world' method for use with the diary/events listings on my NPA site.

    I set no target in the markup, but use js to set it to _blank by default.
    The choice is clear, as is how to change it.

    The switcher itself is also written into the page using js, so users without js aren't presented with a switcher that doesn't work.


    Here's the gubbins from my js file:
    Code:
    // - - - - - - - - - NEW WINDOWS
    
    function extLinkOn() {
    extLinks("_blank");
    }
    
    function extLinkOff() {
    extLinks("_self");
    }
    
    function extLinks(targetVal) {
    	if (!document.getElementsByTagName) return;
    	var anchors = 
    		document.getElementById('events').getElementsByTagName("a"), 
    		aLength = anchors.length;
           for(var i=0; i < aLength; i++) {
    		if (anchors&#91;i].href) {
    			anchors&#91;i].target = targetVal;
    		}
    	}
    }
    
    window.onload = extLinkOn;
    
    function checkTargets() {
    (document.getElementById('targetbox').checked == true) ? extLinkOn() : extLinkOff() ;
    }
    
    
    
    function doLinkTarget() {
    document.write("<form action=\"\"><div><input type=\"checkbox\" id=\"targetbox\" onclick=\"checkTargets()\" checked=\"checked\" />Open links in new Window</div></form>");
    }
    
    // - - - - - - - - - NEW WINDOWS
    Placing the switcher in your markup:
    Code:
    <script type="text/javascript">doLinkTarget()</script>
    -

    msiruit, it's typical for blockers to block popups triggered automatically (e.g. via onload, ), but I don't know of any 3rd-party or native blockers that block popups triggered by manual user events such as onclick.

    Does the blocker that you're referring to block manually-triggered popups?
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  15. #15
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Yes, it a fairly interesting idea - assuming you are using text/html - you have to take for granted the user isn't too slow to notice unclick the checkbox or set the UA to do otherwise.

  16. #16
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you have to take for granted the user isn't too slow to notice unclick the checkbox or set the UA to do otherwise
    I don't quite understand what you're saying in that sentence. Please explain.

    -

    (I assumed that using <XHTML Strict 1.0 was a given as it's unlikely that jakglass was going to leap straight from being a 'Tripod-user' to authentic xml delivery.)
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  17. #17
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Let's take you example page some users might ignore the checkbox and scroll to or click upon one of those external links halfway before realising they have default 'open in new window' especially with it being a scrollable area.

    If the user has a cognitive issue such as short memory span they may forget they scrolled down to have a peak at 'link Z' and the window spawned they might have a little surprise.

    As humans we are designed to be energy efficient, in other words we are inertly lazy therefore basically I was saying its possible they don't expect do such things - or miss the small print.

  18. #18
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sure that, no matter how well you think you have something covered, there'll always be some kind of medical condition or other human shortcoming that will cause certain users to become confused by even the simplest facility.
    Everything has a cut-off point.

    I consider the switcher to be an excellent device as it offers a clear, usable option to everyone barring the completely stupid and those with some unmanagable medical condition.

    You're never going to please everyone all the time, so I don't bother trying.
    I make the site accessible and then set the defaults to favour the users that are most likely to yield a return for the site owner.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  19. #19
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Google's Toolbar caused problem?!

    Quote Originally Posted by msiruit
    I think it is quite normal to have links to external websites open in a new window without a warning...!

    Also, I have found that JavaScript that opens links in new windows are sometimes blocked by pop-up blockers....
    It is so interesting to see my question generating so many interesting views. Thanks guys. From the above message, I uninstalled and re-installed the Google Toolbar and the problem seems solved.

    Just before uninstalling the Google Toolbar, I switched between allow/block pop-ups and noticed that sometimes my hyperlink would open into a new window and other times into the same frame.

    I have re-installed the Google Toolbar and so far, the hyperlinks are working as they should.

  20. #20
    Non-Member c1vineoflife's Avatar
    Join Date
    Sep 2004
    Location
    CA
    Posts
    460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    wow

    Quote Originally Posted by Bill Posters
    I feel the best option is to implement a javascript target switcher to allow users to choose whether external links open in new windows or not.
    I adapted the 'new windows in a compliant world' method for use with the diary/events listings on my NPA site.
    Hey I really like that idea

  21. #21
    SitePoint Addict moonchild's Avatar
    Join Date
    Nov 2003
    Location
    U$A
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by maxor
    Off Topic:


    You shouldn't really be using the target attribute anyhow
    thanks for your words of wisdom... i'll make sure to tell God that this needs to be in the bible.

  22. #22
    SitePoint Wizard silver trophy ldcdc's Avatar
    Join Date
    May 2004
    Location
    Ploiesti
    Posts
    4,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If they want to stick around on your site they'll right-click and choose to open it in a new window.
    No offence, but that's a myth. I've seen "regular" people browsing. They do not use the right click to open in a new window. In fact, most of them don't even use the back button.

    They search for something on google, they click on a link. If the website does not provide the answer they go back to google by typing "google.com" and they search again.

    Really, after a while I feel I'm going nuts just by watching them.

    Yes, I do explain them what they should do, but they're used to their own technique - if we can call it that.
    HostPeek.com - budget hosts, compared
    CouponsNexus.com - web hosting coupons

    Ultra Cheap Hosts | Web Hosting Reviews Forums

  23. #23
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ldcdc
    No offence, but that's a myth. I've seen "regular" people browsing. They do not use the right click to open in a new window. In fact, most of them don't even use the back button.
    Most of the research I've read states that most people know how to use the Back button, and that the Back button is in many cases the only navigation button that people understand properly.

    This strengthens the case against new window links, when you consider that if a link opens in a new window, then people will no longer be able to use the back button, which is in many cases the only navigation button they understand properly. The fact that most people don't open links in new windows by right clicking also strengthens the case against new window links. It doesn't make sense to force a new window upon somebody who doesn't otherwise use multiple windows for browsing and doesn't understand how new window links work. Ending up with multiple browsers visible at once would confuse these people.

    The above are the reasons why we shouldn't force new window links (unexpectedly) on ordinary end users. However, even power users do not like new window links, because these users will already know how to shift+click a link, and so if they want a new window they'll do it themselves. They don't want a link to force itself open in a new window, because for ease of navigation (for instance, if they intend to have a quick look and then go back using the back button) it is often easier not to use a new window for the link. When you force a new window link upon them it is not possible to open the link in the same window.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  24. #24
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    Australia
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In my experience with clients they are well aware of the back button, much less aware of the open in new window option.

    Some great ideas put forward, albeit substantially longer than the old target="_blank" !

  25. #25
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mmj
    It doesn't make sense to force a new window upon somebody who doesn't otherwise use multiple windows for browsing and doesn't understand how new window links work. Ending up with multiple browsers visible at once would confuse these people.

    The above are the reasons why we shouldn't force new window links (unexpectedly) on ordinary end users. However, even power users do not like new window links, because these users will already know how to shift+click a link, and so if they want a new window they'll do it themselves. They don't want a link to force itself open in a new window, because for ease of navigation (for instance, if they intend to have a quick look and then go back using the back button) it is often easier not to use a new window for the link. When you force a new window link upon them it is not possible to open the link in the same window.
    Is anyone here really advocating "forcing" new windows in people even if they knowingly prefer to use a single window?

    Fwiw, it's an interesting observation that those who 'discover' multiple-window browsing, particularly tabbed browsing, rarely, *if ever*, go back to single-window browsing.
    Non-geeky beginners whom I've introduced to Firefox have (perhaps surprisingly) universally appreciate tabbed browsing and recognised it as a superior, more convenient browsing model.

    It is an error to assume that those using single-window browsing are doing so through choice or that they would not appreciate multiple-window browsing.
    A choice of which they are unaware is no choice at all.

    Clear choices are always the best option and, short of giving your visitors a users' guide to their browser, presenting options on your page is a reasonable way of reconciling the preferences of the author with those of the user.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature


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
  •