SitePoint Sponsor

User Tag List

Results 1 to 25 of 28

Thread: Html errors

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Html errors

    I am validating my new site. I get some errors but not sure how to correct them.



    Line 20, Column 80: Bad value text/html; charset=ISO-8859-1 for attribute content on element meta: iso-8859-1 is not a preferred encoding name. The preferred label for this encoding is windows-1252.
    <head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

    Line 279, Column 111: End tag br.

    lorum ibusm</br> lorum ibusmlorum ibusm</h5>

    Line 226, Column 50: No space between attributes.

    <a href="http://www.google.com target="_blank"">


    Error Line 226, Column 56: Quote " in attribute name. Probable cause: Matching quote missing somewhere earlier.

    <a href="http://www.google.com target="_blank"">


    Error Line 226, Column 57: Quote " in attribute name. Probable cause: Matching quote missing somewhere earlier.

    <a href="http://www.google.com target="_blank"">


    Warning Line 226, Column 58: Attribute _blank"" is not serializable as XML 1.0.

    <a href="http://www.google.com target="_blank"">


    Error Line 226, Column 58: Bad value http://www.google.com target= for attribute href on element a: Whitespace in host component. Use %20 in place of spaces.

    <a href="http://www.google.com target="_blank"">

    Syntax of IRI reference:
    Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20.

    Error Line 226, Column 58: Attribute _blank"" not allowed on element a at this point.

    <a href="http://www.google.com target="_blank"">

    Attributes for element a:
    Global attributes
    href
    target
    download
    rel
    hreflang
    type

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    You need an extra quote here:

    Code:
    <a href="http://www.google.com" target="_blank">
    Also, target="" is deprecated and should ideally be avoided. It depends on what doctype you are using whether you will get a warning for it or not, though.

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I do not understand why i get _blank""> in my html there is no double quote.

    What is wrong with<br/>

    Is this okay to use ?, as i get an error : meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay, what could i use instead of target="_blank" ? What is wrong with my <br> tag ?

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,871
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ingenting View Post
    okay, what could i use instead of target="_blank" ??
    Nothing. When you use a target attribute you reduce the options available to your visitors. If they want to open a link in a new tab or window then they will right click on the link and select the appropriate option for where they want to open the link. If you use that attribute then you reduce their choices on where to open it from three to two unless they know how to override your obsolete code in their browser.

    You should be trying to make things easier for people visiting your site - not harder. When you make things harder for your visitors by reducing their choices they will leave your site and go somewhere that lets them choose to do things the way they want.

    Trying to dictate where links open was something done back in the 20th century along with placing hit counters on the page and various other things that make a site today appear very ameteurish or extremely dated.
    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="^$">

  6. #6
    SitePoint Enthusiast
    Join Date
    Feb 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Nothing. When you use a target attribute you reduce the options available to your visitors. If they want to open a link in a new tab or window then they will right click on the link and select the appropriate option for where they want to open the link. If you use that attribute then you reduce their choices on where to open it from three to two unless they know how to override your obsolete code in their browser.

    You should be trying to make things easier for people visiting your site - not harder. When you make things harder for your visitors by reducing their choices they will leave your site and go somewhere that lets them choose to do things the way they want.

    Trying to dictate where links open was something done back in the 20th century along with placing hit counters on the page and various other things that make a site today appear very ameteurish or extremely dated.
    Thanks for your reply. I will not use target then. The reason why i want to use it, is i am afraid they will never find back to my page, If they click on 10 pages on the other site. They wil have to hit back a couple of times.

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,331
    Mentioned
    463 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by ingenting View Post
    The reason why i want to use it, is i am afraid they will never find back to my page, If they click on 10 pages on the other site. They wil have to hit back a couple of times.
    The question then would be, do you really need those external links? Why are you sending them to other sites?

  8. #8
    SitePoint Enthusiast
    Join Date
    Feb 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Nothing. When you use a target attribute you reduce the options available to your visitors. If they want to open a link in a new tab or window then they will right click on the link and select the appropriate option for where they want to open the link. If you use that attribute then you reduce their choices on where to open it from three to two unless they know how to override your obsolete code in their browser.

    You should be trying to make things easier for people visiting your site - not harder. When you make things harder for your visitors by reducing their choices they will leave your site and go somewhere that lets them choose to do things the
    way they want.

    Trying to dictate where links open was something done back in the 20th century along with placing hit counters on the page and various other things that make a site today appear very ameteurish or extremely dated.

    What about on Tablets and other mobile devices ? I dont get, why in some cases it is not okay to use target_blank. Or is there some cases it is ok ? What about giving the user an option alert box ?

  9. #9
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,871
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ingenting View Post
    I dont get, why in some cases it is not okay to use target_blank. Or is there some cases it is ok ? What about giving the user an option alert box ?
    The target attribute was deleted from HTML in 1997 when it was decided that it is better to give your visitors a choice of where they want links to open. Even before then you could right click on a link to choose whether to open it in the same window or a new window. Now some browsers give the choice of same tab, new window in front, new window in the background, new tab in front, or new tab but keep the current one open. Specifying a target has the effect of removing one of those choices for those of your visitors who don't know how to disable the target attribute completely in their browser.

    An alert box is a tool for debugging JavaScript. In most browsers it displays a checkbox allowing all subsequent alerts to be turned off, in others it displays a checkbox to allow JavaScript to be completely turned off for the specific page. It should never be used on a live web page.

    There are NO cases where using target are okay - if there were then the attribute wouldn't have been deleted from HTML back in 1997. You should ALWAYS give your visitors the option of where to open pages and you do that by NOT specifying a target.
    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="^$">

  10. #10
    SitePoint Enthusiast
    Join Date
    Feb 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One more question. Is it ok to upload a site to another domain for testing out errors- or could it harm SEO in someway ?

  11. #11
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,821
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    What is wrong with my <br> tag ?
    exactly! you have </br>

    also I would check the source code that's generating your HTML, or maybe the data you are using. My theory is, it generates only an HREF. Target is a different attribute. So, if I am correct whats happening is you are sending this string : 'http://www.google.com target="_blank"' which is being placed in 'href="$yourString"' ... and thus 'href="http://www.google.com target="_blank""'

    perhaps the string you send should look like : 'href="http://www.google.com target="_blank' but you wuld have to check both your data and your generating source

  12. #12
    SitePoint Enthusiast
    Join Date
    Feb 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dresden_phoenix View Post
    exactly! you have </br>

    also I would check the source code that's generating your HTML, or maybe the data you are using. My theory is, it generates only an HREF. Target is a different attribute. So, if I am correct whats happening is you are sending this string : 'http://www.google.com target="_blank"' which is being placed in 'href="$yourString"' ... and thus 'href="http://www.google.com target="_blank""'

    perhaps the string you send should look like : 'href="http://www.google.com target="_blank' but you wuld have to check both your data and your generating source
    Sorry, but do sure what you mean by "data and your generating source"

  13. #13
    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)
    It'd probably help if I could see the code itself, for those other errors though it seems like there might be a mismatch occurring.

    However, the ISO-8859-1 message might be just a "warning" in the Validator; ISO-8859-1 and windows-1252 are very similar encodings and the browser might assume the latter hence the error. Though you'd probably be better with declaring UTF-8. Also you could have forced the Validator to use: ISO-8859-1 if you really wanted though it's not usually done.

  14. #14
    SitePoint Enthusiast
    Join Date
    Feb 2013
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Robert, could you write what you are using with utf-8, btw it is a danish site does that mean anything ?

    Is there a way to post link to my site, without google can see it ? would really like to show the site, and the problems i have. But i dont want it to show up when somebody google the site.

  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)
    Probably the best solution is to save the file as UTF-8 itself, and use UTF-8 as the charset value since the document will be written using the Danish alphabet and some letters may have diacritic signs.

    Perhaps the web editor you were using wasn't using the same encoding. UTF-8 can be used for all languages and is the recommended charset on the Internet.

    I use the encoding declaration of the XML declaration on the first line of the page: <?xml version="1.0" encoding="UTF-8"?> though you may not want to.

    I'd suspect you'd be better off using: <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> since you be likely to be serving the file as 'text/html'.


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
  •