w3c validation

Discussion in 'HTML Basics' started by shakemelikeapig, Apr 1, 2012.

Tags:
  1. shakemelikeapig

    shakemelikeapig New Member

    I got errors with w3c validation for html with javasript and it variables definitions are not good for w3c validation. These javascript codes are from ad snippets from ad company on my sites which I can't change.
    Please tell me how to fix the error. You can check bit.ly/H7zuPj for w3c validation errors.

     
  2. nathan.joshua

    nathan.joshua New Member

    You can use tags to exclude JavaScript from validators.

    start tag is:
    //<![CDATA[
    end tag is:
    //]]>

    This is an example of how I use it:

    [TABLE]
    [TR]
    [TD="class: webkit-line-content"] <script type="text/javascript"> [/TD]
    [/TR]
    [TR]
    [TD="class: webkit-line-number"][/TD]
    [TD="class: webkit-line-content"]//<![CDATA[[/TD]
    [/TR]
    [TR]
    [TD="class: webkit-line-number"][/TD]
    [TD="class: webkit-line-content"]$.easing.custom = function (x, t, b, c, d) {[/TD]
    [/TR]
    [TR]
    [TD="class: webkit-line-number"][/TD]
    [TD="class: webkit-line-content"] var s = 1.20158;[/TD]
    [/TR]
    [TR]
    [TD="class: webkit-line-number"][/TD]
    [TD="class: webkit-line-content"] if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;[/TD]
    [/TR]
    [TR]
    [TD="class: webkit-line-number"][/TD]
    [TD="class: webkit-line-content"] return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;[/TD]
    [/TR]
    [TR]
    [TD="class: webkit-line-number"][/TD]
    [TD="class: webkit-line-content"]}[/TD]
    [/TR]
    [TR]
    [TD="class: webkit-line-number"][/TD]
    [TD="class: webkit-line-content"]$("div.scrollable").scrollable({easing: 'custom', speed: 1800, circular: true});[/TD]
    [/TR]
    [TR]
    [TD="class: webkit-line-number"][/TD]
    [TD="class: webkit-line-content"]//]]>[/TD]
    [/TR]
    [TR]
    [TD="class: webkit-line-number"]</script>[/TD]
    [TD="class: webkit-line-content"]






    [/TD]
    [/TR]
    [/TABLE]
    Hope this helps!
     
  3. shakemelikeapig

    shakemelikeapig New Member

    How to put cdata within javascript codes? You can check the w3c by bit.ly/H7zuPj

    error:

    Also, please tell me how to fix the other errors. 44 errors and 15 warnings.
     

Share This Page