Web Analytics Made Easy -
StatCounter Help!? JavaScript does not allow element div - CodingForum

Announcement

Collapse
No announcement yet.

Help!? JavaScript does not allow element div

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help!? JavaScript does not allow element div

    I am using a jQuery slider for a website but the W3C comes up with invalid because:

    document type does not allow element "div" here
    .before('<div id="buttons">')

    Code:
    <script type="text/javascript">
    $(document).ready(function() {
    $('#slider')
    .before('<div id="buttons"></div>')
    .cycle({
    fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    pager:  '#buttons'
    });
    });
    </script>
    Any help with this would be appreciated thanks.

  • #2
    Didn't I already reply to this one?

    There is nothing illegal about this javascript string. It is a mistake of the W3C validator to complain about this.

    Comment


    • #3
      Thanks devnull69,

      It doesn't seem to like the <div> tag being inside the javascript, it might be because it is strict instead of transitional.

      Sorry if I posted twice I don't know what happened to my other post couldn't see it anywhere.

      Comment


      • #4
        No, it doesn't have anything to do with strict or transitional. You should either keep the Javascript part out of the validation or ignore the results for the Javascript part.

        Comment

        Working...
        X