SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 26
  1. #1
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Corner seat
    Posts
    1,069
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Non-JavaScript XHTML compliant New Window Links?

    I read this article http://www.sitepoint.com/article/sta...pliant-world/1 short while ago and I've been using it ever since. This is a short script to create XHTML compliant New Window links in case you haven't read.

    It's a great script, but the problem is that it requires JavaScript. Is there some way to create XHTML compliant New Window links without using JavaScript? (If you could, the script wouldn't be using JavaScript in the first, would it ...?)

  2. #2
    SitePoint Wizard Dangermouse's Avatar
    Join Date
    Oct 2003
    Posts
    1,024
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only way i know of of opening a new window, is using _blank in the <a> tag, but to open a window and manipulate what it looks like (toolbars, size etc) you have to use a client side language like javascript.

  3. #3
    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)
    Use eXtensibility to reintroduce the 'target' attribute, but it was removed for a good reason.

    Plus unless you serve XHTML as an application of XML you are not better off using 1.1 over XHTML 1.0 Transitional.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    The Netherlands
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree with xhtmlcoder. If people have disabled Javascript, they've usually done it for a good reason (e.g. preventing popups ). I actually prefer the method described here (or my personal variation: <a href="link" onclick="window.open(this.href);return false"> ). This way, each user gets what he wants: the link in a popup if javascript enabled, or in the same window if javascript is disabled.

    And to make a long story short: no, there's no other way to do this, except moving from strict to transitional.

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by stoli_sambuca
    I read this article [url]
    It's a great script, but the problem is that it requires JavaScript. Is there some way to create XHTML compliant New Window links without using JavaScript? (If you could, the script wouldn't be using JavaScript in the first, would it ...?)
    HTML Code:
    <a href="http://whatever.com/" target="_blank">XHTML-compliant new-window link</a>
    Why are people so scared of XHTML 1.0 Transitional??

  6. #6
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think that article misses the point anyway - compliant pop-up windows is an oxymoron - target is deprecated because we shouldn't be opening new windows at all

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by brothercake
    I think that article misses the point anyway - compliant pop-up windows is an oxymoron - target is deprecated because we shouldn't be opening new windows at all
    That's my view on the situation. If you need to open a new window link, that's not exactly strict coding you're doing, so you might as well drop into Transitional/Frameset instead.

  8. #8
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    The Netherlands
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by brothercake
    I think that article misses the point anyway - compliant pop-up windows is an oxymoron - target is deprecated because we shouldn't be opening new windows at all
    Yes and no
    Opening a popup window can be useful, but if it's just to prevent the user from totally abandoning your site, I think it's not useful.
    IMO, popups are useful when you want to user to enter some information (or give some information) but don't want them to lose the "big picture". For example, a small popup window with some help text, or have the user enter some more specific information, while completing a larger form.

    Of course, all this can be done by hiding and showing divs with the info or additional fields, but a nice popup window can help as well.

    And if you use popups to link to external site, add a small icon with css after the link, so the user gets a visual clue that he's leaving the site.

  9. #9
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Monterey County, CA
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Chevalric
    And if you use popups to link to external site, add a small icon with css after the link, so the user gets a visual clue that he's leaving the site.
    Bit of a tangent, but could you explain how to do this?

  10. #10
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by A_Brisson
    Bit of a tangent, but could you explain how to do this?
    2 ways:

    Method 1, which is the most cross-browser method, but requires more code:
    Code:
    a.external {
      padding-right: 10px;
      background-image: url(/images/external.gif);
      background-repeat: no-repeat;
      background-position: right;
    }
    HTML Code:
    <a class="external" 
    href="http://www.example.com/" 
    onclick="window.open(this.href); return false;">Example</a>
    Method 2, which uses CSS2 so it won't work in IE, but uses less code:
    Code:
    a[onclick], a[target="_blank"] {
      padding-right: 10px;
      background-image: url(/images/external.gif);
      background-repeat: no-repeat;
      background-position: right;
    }
    HTML Code:
    <a href="http://www.example.com/"
    onclick="window.open(this.href); return false;">Example</a>
    Use the one that's appropriate for your site.

  11. #11
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Chevalric
    And if you use popups to link to external site, add a small icon with css after the link, so the user gets a visual clue that he's leaving the site.
    I don't agree with using new windows to link to an external site - sites only do that for their own benefit - it doesn't benefit users. And I don't believe people need to be told they're leaving one site and going to another - isn't it obvious when the design changes?

  12. #12
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by brothercake
    And I don't believe people need to be told they're leaving one site and going to another - isn't it obvious when the design changes?
    however - not just in terms of accessibility, but usability as well - shouldn't you warn the user of what is going to happen ? we're only talking about a small graphic or a little warning in the title ("external link: blah blah"), and this would obviously also depend on context (e.g. on a page specifically set up for links to other sites, it would probably be overkill to do this, as the context of the page itself should give the user enough warning in itself).

    Off Topic:


    "shouldn't we label this self-destruct button ?"
    "nah...isn't it obvious when the thing explodes ?"
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  13. #13
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by redux
    however - not just in terms of accessibility, but usability as well - shouldn't you warn the user of what is going to happen ?
    No I don't believe you should - or rather, I don't believe you need to - I think usability is being used as a lynch-pin to justify what is really only for our benefit.

    Users are not aided by being told they're leaving one site and going to another. Either they already know from the myriad of other cues, or they don't care.

    Only we care, because we want them to stay on our site, or remember that it was "our site" rather than "one of those other sites"

  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)
    …really only for our benefit.
    Even if that *were* true (which I believe is not the case) - what's so wrong about that?
    Since when do websites *have to* be entirely selfless?

    I've witnessed users become disorientated when a link replaces their current window with a completely different site. Similarly I have seen users remain intuitively aware of what's taken place when an external link has opened in a new window.
    Users in general are becoming increasingly comfortable with exploring several tangents at once.
    The visual cue of a link appearing in a new window is reassuring to some that they have are no longer viewing that site, but still retain a finger on the original page. (Travelling deep into a new site often means novices tapping the back button repeatedly.
    I disagree with the notion that the hyperlinked structure of the web *should* limit its users to doing only one thing at a time.
    The popularity of tabbed browsing goes some way to showing that the 'one window web' is becomgin increasingly outmoded.
    Imho, it runs counter to the aspirations of a hyperlinked web by forcing a degree of singular linearity onto a user's path.


    The point is that no single rule exists that can satisfy every user.
    In the absence of (accurate) universal user preferences, I feel the site's author can reasonably expect to have some say as to whether or not external links on *their* site should open in a new window.
    As long as they're clear about it (re: new window icon/indicator) then users know what to expect.
    By idealistically limiting the web experience to a single window I think we're in danger of patronising users ability to learn and understand, the detriment of our ideas and our sites - and the detriment of the progressive potential of the web.
    New Plastic Arts: Visual Communication | DesignateOnline

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

  15. #15
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by brothercake
    Users are not aided by being told they're leaving one site and going to another. Either they already know from the myriad of other cues, or they don't care.
    i call BS on that one. what myriad of other cues are you talking about, huh ? oh, you mean the cues that are given after they've already left ?

    have you ever done some usability tests, actually sitting there with an average joe user and seeing how they operate a site ? i've come across countless instances where they click a link which goes completely off site and they're left wondering "what the heck just happened ? where am i ? how do i get back ?". even more fun when the external site they ended up on is using crappy javascript redirection etc which completely breaks their back button (which, in many cases, you even have to tell them how to use).

    Only we care, because we want them to stay on our site, or remember that it was "our site" rather than "one of those other sites"
    i call BS again. your generalisations don't help this argument, i'm afraid. i for one couldn't care less if people go off one of my sites, as i believe that they'd come back if they found the content more appealing/interesting than "those other sites". what i don't want, however, is confusion for the user.
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  16. #16
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well okay I guess I'm confusing what I prefer with general preference. The other cues I was referring to are things like the link URL in the status bar, sometimes the context of the link, and yes, retrospective cues like a change in design scheme, that tell you you have left a site, if not that you're going to.

    I'm not anti-indicating that a link is to an external resource - although I do find those arrows confusing because some sites use them for links that are not external, and I don't do it myself.

    I just can't help but feel that sometimes, "usability" is used to justify things that are primarily for our benefit - and I'm not saying doing things for our benefit is wrong, I just mean call something what it is.

  17. #17
    SitePoint Evangelist ClevaTreva's Avatar
    Join Date
    Jan 2004
    Location
    Chipping Campden, UK
    Posts
    403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    I find myself in total agreement with redux. I often put links on my site just to thank others for their help, or that my users (members) may find useful. In the main, I preface them with some comment like these links open in a new window ...

    BUT, most of my members, whilst able to surf the net, couldn't even right mouse click a link to open in new window. I don't use target to avoid them leaving the site, they asked me to do it so that a window would still be open for them to flick back to, rather than have to wait for it to load again.

    I find myself frequently using target to go to specified windows that may already be open. For example, our site has a serach page and search boxes on each page. Do a search and the search page opens, leaving the old page open too. Moreover, the users often don't want to browse from the search page by losing their search results, so they prefer the links to open in new pages. For repeated searches from the boxes on our normal pages, the browser will switch to the already open search page if it is open, which has some java to make to the focus again.

    And anyway, what about CSS3, which has both target window and tabs in the specs?




    Trevor

  18. #18
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ClevaTreva
    I don't use target to avoid them leaving the site, they asked me to do it so that a window would still be open for them to flick back to, rather than have to wait for it to load again.
    Huh? They asked you to do this, and your response was something other than to inform them of the existence of "right-click" and "open in new window"? Sorry I'm not trying to take the mick, but I don't see how discouraging users from making the most of their interface is helpful to them in the long run. And how do you know that the people who mailed you represent the majority, rather than a vociferous minority?

    If you don't target links, users have a choice. If you target links you've taken that choice away from most people. How does that benefit them?

    Quote Originally Posted by ClevaTreva
    And anyway, what about CSS3, which has both target window and tabs in the specs?
    Let's hope that dies a suitable death long before it gets out of Working Draft ...

  19. #19
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A choice that you aren't aware of is no choice at all.

    From that starting point, it could reasonably be argued that making the decision to hand users the opportunity to follow multiple lines of enquiry/interest at a time (via multiple windows) is a greater example of offering choice than forcing them (in their ignorance) to follow only one.
    Above all, by handling the targeting via script, the user maintains the ability to enforce their own choices by overriding any settings established by a site's author.

    If a user finds a site's use of new windows for external links, then it may just force them to examine the browser they use and the user-oriented features it may support.
    Not an ideal way of educating users regarding their software and their choices, but in lieu of placing browser user guides on our sites, the ignorant should expect to have decisions made for them by more knowledgable people.
    New Plastic Arts: Visual Communication | DesignateOnline

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

  20. #20
    SitePoint Evangelist ClevaTreva's Avatar
    Join Date
    Jan 2004
    Location
    Chipping Campden, UK
    Posts
    403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bill Posters
    A choice that you aren't aware of is no choice at all.

    From that starting point, it could reasonably be argued that making the decision to hand users the opportunity to follow multiple lines of enquiry/interest at a time (via multiple windows) is a greater example of offering choice than forcing them (in their ignorance) to follow only one.
    Above all, by handling the targeting via script, the user maintains the ability to enforce their own choices by overriding any settings established by a site's author.

    If a user finds a site's use of new windows for external links, then it may just force them to examine the browser they use and the user-oriented features it may support.
    Not an ideal way of educating users regarding their software and their choices, but in lieu of placing browser user guides on our sites, the ignorant should expect to have decisions made for them by more knowledgable people.
    In different words, precisely my point. If the user has the understanding to disable java, then I would expect them to understand how to navigate in their browser. Their choice. At the end of the day, all we can do is make what we think is the best choice in coding. I do not FORCE a user to stay on my site by using targets because I am afraid of them leaving. A non-commercial site, with no advertising, why on earth should I?

    No, I hazard a guess as to whether, with a given link, they are likely to want to leave or are just curious as to what lays beyond that link and would likely want to stay on my site. Of course, I am taking the decision away from them, but they can chose to close the window or leave and never come back. Given the exponential rise in visitors (I do NOT advertise the site at all, just rely on Google etc), I must be doing something right! But I agree, my choice IS taking away user choice, but I am not about to start running turorials on how to use browsers. They can buy a dummies guide for that.





    Trevor

  21. #21
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So in order to prevent links from opening in new windows, I have to either disable javascript altogether, or use a different browser. And that seems reasonable to you?

    As to why should you care, well, if you can't think of a reason there probably isn't one.

  22. #22
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Another option would be to find a site that better suits your preferences.*

    A site author who felt it was critical to their users to offer them a clear option could easily implement a js method allowing users to switch the new windows specification off/on.
    Some do.

    (* It's not completely unreasonable for site authors to wish that their preferences as to how their site is presented remains intact. After all, not everyone would agree that the best way to handle a brand is to make it bend any which way any user wants. Not every website is trying to be all things to all people. Some prefer a tightly focusses experience that attracts sympathetic users who share the same values and priorities.
    How a site 'handles' its users is all part of that.
    I for one can understand and appreciate how that attitude may be well-suited to some sites.)
    New Plastic Arts: Visual Communication | DesignateOnline

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

  23. #23
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's fair enough - not all sites are catering to everyone - in fact almost all sites cater only to a subgroup of people.

    I'm not entirely anti-new-window - I just think that for any given site, if could you compare the number of people who like that off-site links open in a new window, with those who'd rather they didn't but don't know they can prevent it ... well my intuition is that the latter group would dominate significantly.

    Maybe I'm wrong - it's just not something I'd care to do, because it does reduce choice - visitors may not mind, they may not even consciously notice, but short of doing a representative audience survey, how would you know?

  24. #24
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I completely appreciate your point, but I've never really had that much respect for the don't make me think school of (web) design.
    I, personally, would never recommend pandering to the ignorance of users if there was reason to believe the consequences of doing so could risk harming the general success of a site/offer/product.
    That said, I'm not as dogmatically opposed to it as I have been in the past. I'm now comfortable with the idea of meeting them half-way (read: encouraging/forcing them to develop a preference).
    Rather than 'make lemonade', I advocate offering just enough info to allow your uneducated users to make an untyically educated decision.
    Rather than let them stay ignorant and act out of that ignorance (with possible detremental consequences for out sites and their general browsing experience), educate them. Present them with the choice of which they weren't aware and require them to develop a preference through knowledge.

    This could be done a number of ways.

    Given that new windows should (now) ideally be handled via script, it's not hard to adapt the basic principles in SP's new window script to accomodate a script-based switcher.
    In fact, my recent interest in this thread has provided the impetus for me to add a switcher to the events listings on my own site.
    I was previously using an adapted version that left js users with no choice other than to have those links appear in new windows.
    I wasn't especially uncomfortable with that situation*, but I now feel that I've gone that last mile and covered all eventualities.
    Of course, I've defaulted the targets to _blank for js users ( ), but they now have a way to revert to _self.

    (* though it's highly likely that the better informed browser visitors would themselves be using new tabs for these links)


    It is possible to find a balance between pragmatic markup, consideration and the ideals of a site's author.
    Pandering to users' ignorance doesn't really help anyone - including users. The popularity of tabbed browsing amongst those aware of the choice goes some way to showing that single-window browsing may not be the way that most uninformed user would ideally prefer to browse.
    By educating our users about the choices that already exist or by presenting options directly on our sites (often the simplest option), we can help the web to move forward and out of an era where 'backward compatible' may just as fittingly refer to certain 'users' as it does to certain technology.
    New Plastic Arts: Visual Communication | DesignateOnline

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

  25. #25
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fine, but you are still assuming that other people's preference are likely to match your own - you consider yourself a knowledgeable user, and you have certain preferences (tabbed browsing etc) and certain knowledge (how to use and customise your browser etc), but its a fallacy to think that other users of equivalent knowledge will necessarily have the same preferences.

    You know - I can stop links opening in new windows; I can use "this window" in Firefox and it ends my troubles - I'm never bothered by popup windows. Except I am - because I still have to make a point of doing that, after I've innocently clicked a link and its opened a window I didn't want. It's still annoying.

    I'm a knowledgeable user, and popups still piss me off. Sure that's my opinion - and my opinion is no more important than anyone else's. But my point is - you cannot assume that only "ignorant" users are affected by this .. anymore than you should presume to "educate" them otherwise - it is, if you'll forgive my saying so, the height of arrogance.


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
  •