SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Attribute not recognised on one line, but fine on next

    After reverting back to html 4.01-strict from xhtml and making the necessary alterations, I ran the page through a validator.
    I got 1 error, but a really strange one.
    To open links in a new tab, is use the [ target="_blank ] system. There are plenty of these on the page, but only one comes up as an error in the validator. Why?

    All the others are exepted, only the first one is not.
    All the links work by the way.

    [<a href="http://www.boiler-breakdown-repair-london.co.uk/wp" target="_blank"> The Boiler Repair BLOG</a>] error


    [ <a href="http://www.boiler-breakdown-repair-london.co.uk/flue-gas-analysers-boiler-repairs-south-east-london-bromley.html" target="_blank"> Flue Gas Analysers</a> ] fine

    Only thing I can think of is that all the working links end with either .co.uk or .html
    But why would that influence the validator on regcognising the "target" attribute?

  2. #2
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,830
    Mentioned
    111 Post(s)
    Tagged
    1 Thread(s)
    I can't see anything wrong in what you've put there so I suspect there may be something else that isn't right. Can you give a link to the page?

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Here it is
    problem page

  4. #4
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,830
    Mentioned
    111 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by benbob View Post
    Here it is
    problem page
    It looks to me as though the validator is trying to avoid "double jeopardy" because the error is exactly the same throughout the page, it is only telling you about it once rather than 43 times. If I copy the source and paste it in, but delete that one line, it highlights the next one as an error. So there's nothing special about that one link, other than that it's the first one using the target attribute.

    This does raise the question of why you want those links opening in new windows, given that one thing that's pretty much guaranteed to do is annoy and confuse your visitors. It's annoying enough when external links ignore my wishes and force a new window, but I really cannot see any reason for doing it with all those internal links.

  5. #5
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    The target attribute is not valid with the Strict doctype. The validator is flagging the first instance only and ignoring the rest, as you'll see if you remove the target from it. Either switch to Transitional or use javascript to open in a new window. Bear in mind that, for the user, being forced to open links in a new window can be a pain in the posterior.


    Off Topic:

    I suspect the reason rats gnaw at plastic piping is that they sense the hollowness and are trying to get inside.

  6. #6
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    It's a matter of preference I suppose. When looking for specific information, I usually open links in a new tab in order to be able to verify things I don't quite get.
    The feedback I get from my site is very good, even when I speficially ask for things people didn't like. Opening in new tabs has never been mentioned as unwanted to me.

  7. #7
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Victorinox View Post
    The target attribute is not valid with the Strict doctype. Is this just a problem for the validator, or is it also likely to give dislay/parsing problems for visitors?...
    I'd like to stick tot Strict, but it's a means to an end and not the Holy Grail. I try to avoid Javascripts as much as possible, so I'd rather switch to Transitional if need be.


    Off Topic:

    I suspect the reason rats gnaw at plastic piping is that they sense the hollowness and are trying to get inside.

    Unlikely; they attack leccie cables too.
    Usually only once.

  8. #8
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by benbob View Post
    It's a matter of preference I suppose.
    Hence the benefit of allowing the user to choose their own preference for opening in the same window, new window, or new tab.

  9. #9
    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)
    Personally I'd remove those target attributes they were "deprecated" from HTML 4.01 for a very good reason and are supposed to be used with Frames only. If you open windows using unobtrusive JS instead they will still function as links with or without scripting.

    The only reason they are opening in a new tab is because you set the browser to do so. For _blank the user agent should load the designated document in a new, unnamed window.

    In otherwords breaking the navigation back button... since those links on the said page are going to your own website each time you'd click one of those links a new tab/window appears cluttering everything up and possibly confusing the user.

    One who is too insistent on his own views finds few to agree with him. Aim to 'let the user decide' whether they want to open the link in a new tab, or window. Most of them will already generally open links in new windows only if that's already their own preferred habit.

    The way you have it now they really have 'no choice in the matter' creating unnecessary web accessibility issues. At the minimum when new windows are likely to be spawned; it helps if you inform the user.

  10. #10
    SitePoint Evangelist
    Join Date
    Jun 2011
    Location
    London UK
    Posts
    495
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Don't get too upset about the annoying stuff that is currently their folks; I'm in the process of re-designing the whole site (again ) and most of the annyoing stuff, especially on this testpage, is only there for test purposes and most of it will probably disappear.
    For exampe, the expanding of links will probably only be for a few that are displayed in very small font for space purposes, and the new window opening will be kept for my blog section, but probably not for much else.

  11. #11
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    Quote Originally Posted by benbob View Post
    I'd rather switch to Transitional if need be.
    There's no need. Just because the validator squeals means nothing per se. The only reason to take note of the validator is to ensure there are no potential problems that will cause your pages to fail in the browser.

    As others have said, things get deprecated for a reason. If opening a link in a new tab/window has been abandoned on the web, you should at least investigate why. Tests have shown that it causes a lot of confusion.


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
  •