1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

W3C Validation Error

Discussion in 'HTML & Website Design' started by RB!, May 21, 2011.

  1. #1
    I got the following W3C validation error, anyone know what it means and what I need to do to fix it?

        
    Error Line 4, Column 107: required attribute "type" not specified
    
        …m/wp-content/w3tc/min/af662d6c8edd6ede7e7667dff58500cc.1119815148.js"></script>
    
    The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.
    
    Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
    
    Code (markup):
     
    RB!, May 21, 2011 IP
  2. WebPageMistakes

    WebPageMistakes Active Member

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    60
    #2
    
    <script type="text/javascript" src="path to your script"> </script>
    Code (markup):
     
    WebPageMistakes, May 21, 2011 IP
  3. RB!

    RB! Active Member

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Thanks! That makes sense. However I am having trouble finding where to add the type="text/javascript"

    It is a Wordpress blog and I have looked under the index.php and header.php files in my WP CP, but can't find that specific link.

    Any suggestions?
     
    RB!, May 21, 2011 IP
  4. WebPageMistakes

    WebPageMistakes Active Member

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    60
    #4
    Is this for a plugin you are using or something else?
     
    WebPageMistakes, May 21, 2011 IP
  5. RB!

    RB! Active Member

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    nope, error is straight from the home page
     
    RB!, May 21, 2011 IP
  6. WebPageMistakes

    WebPageMistakes Active Member

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    60
    #6
    Can you show me the url? You can PM me it if you don't want a link here to it.
     
    WebPageMistakes, May 21, 2011 IP
  7. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #7
    Browsers no longer need the 'type' attribute and it's been changed in the HTML5 spec so that <script> always means javascript and <style> always means css EXCEPT when the 'type' attribute is used and indicates otherwise. The HTML 4.01 validator will still flag it, though.
     
    drhowarddrfine, May 21, 2011 IP
  8. fireworking

    fireworking Peon

    Messages:
    460
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Usually, there is not much to worry about unless you are being evaluated on if your website validates (like for a competition or school project that the teacher wants you to validate it).

    But, as for your case, some WordPress plugins don't really care about validation and therefore don't add type="style/css" or type="text/javascript". If you don't really need validation, don't worry, because it won't even affect your website in a negative way because you are making sites for humans to do, not robots (unless you are very picky about seo). But, it is also debatable that validation affects your seo rankings, some say they do, some say they don't.

    I cant really help you much unless you provide a url here.

    I would just say, focus on the big picture.
     
    fireworking, May 21, 2011 IP
  9. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #9
    Humans view the internet through a browser which, essentially, is a robot. Validation ALWAYS makes the browser's job easier. Ignoring validation is a peril to your site.
     
    drhowarddrfine, May 22, 2011 IP