Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Mar 2013
    Location
    Ontario Canada
    Posts
    10
    Thanks
    3
    Thanked 1 Time in 1 Post

    Validation/Page Speed errors

    In Validating a new site (www.keystonerubber.ca) I am encountering a few errors that I don't understand. I have tested in many browsers and it works as expected but I just started programming about 5 weeks ago and would like to understand what I did wrong and fix it. It is built with XHTML 1.1, CSS, Javascript and PHP. Any help would be appreciated.

    1. Page Speed and Mozilla indicate that images are not sized and slowing rendering. Other than the width of the large image in the picture gallery all dimensions are in the CSS. In Mozilla when I use 'Show Image Dimensions' exist and are accurate. However when I 'Outline Images Without Dimension' they also show up. Obviously I am missing something but I don't understand what it is.

    2. I use Javascript in the Picture Gallery to dynamically generate the XHTML for flexibility and speed. Validator is reflecting 2 errors and a warning. To me the code looks right and works but I have seen similar errors in other places and am not sure where to learn what I need to understand this.

    3. All of my Product pages have the same 4 errors for the use of structured markup schemas for search engines (i.e. no attribute: "itemscope", "itemtype", "itemprop"). Google validates that it works for their search engine which was the objective but it would be nice to validate clean.

    Thanks in advance for any help!

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,089
    Thanks
    23
    Thanked 593 Times in 592 Posts
    Can't do anything with out code. Post it here or give us a link to your site.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    New Coder
    Join Date
    Mar 2013
    Location
    Ontario Canada
    Posts
    10
    Thanks
    3
    Thanked 1 Time in 1 Post
    The link is in the first post (http://www.keystonerubber.ca

  • #4
    Regular Coder
    Join Date
    Mar 2013
    Posts
    262
    Thanks
    4
    Thanked 67 Times in 67 Posts
    #1. It's not required, but it is recommend that you specify the dimensions of an image in the image tag. So something like...

    Code:
    <img src="image.jpg" width="20" height="20" />
    According to w3, the "height and width attributes give user agents an idea of the size of an image or object so that they may reserve space for it and continue rendering the document while waiting for the image data." Using CSS is fine, and Google's Page Speed says as much, but using the image attributes is "preferred" (I guess).

    #2. I'm certain that this also isn't much of an issue, but for inline JavaScript and XHTML documents, you should wrap them around in a CDATA section like this:

    Code:
    <script type="text/javascript">//<![CDATA[
        alert('hello');
    //]]></script>
    #3. You would need to switch to an HTML5 doctype.
    Last edited by ttkim; 04-16-2013 at 06:11 PM.
    My signature :)

  • Users who have thanked ttkim for this post:

    golf-addict (04-16-2013)

  • #5
    New Coder
    Join Date
    Mar 2013
    Location
    Ontario Canada
    Posts
    10
    Thanks
    3
    Thanked 1 Time in 1 Post
    Thank you for the reply.

    1. the w3 link says width and height has been deprecated to style sheets which is what I used. Seems like they are loaded earlier I still don;t understand why this is a problem

    2. The reference to CDATA was helpful. I did a little research and decided to move the js to an external file which makes the validator happy and seems less convoluted.

    3. Caused me to reevaluate XHTML vs HTML5. I preferred the strict syntax of XHTML and actually switched from HTML5. Looks like I have options for that and might be switching back:-)

    Thanks for your help!

  • #6
    New Coder
    Join Date
    Mar 2013
    Location
    Ontario Canada
    Posts
    10
    Thanks
    3
    Thanked 1 Time in 1 Post
    Site has been updated to HTML5 and with the advice provided every page validates clean.

  • Users who have thanked golf-addict for this post:

    ttkim (04-17-2013)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •