javascript non w3 compliant

  • thesquareone
  • Novice
  • Novice
  • thesquareone
  • Posts: 23

Post 3+ Months Ago

Hi guys,

I recently came across an issue that im sure some of you know about have dealt with and now consider a very easy thing to sort out,

basically im wishing to keep every website i do w3 compliant something i think is critically important as a designer, before now I hadnt included used any javascript, on my first go at using it, i tried to check my web site was still w3 compliant, irritatingly it wasnt, am i doing something basic wrong.

is there an issue with keeping javascript as w3 compliant, or is it just not possible ?

many thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Code: [ Select ]
<script type="text/javascript">
// <![CDATA[

Code goes here

// ]]>
</script>
  1. <script type="text/javascript">
  2. // <![CDATA[
  3. Code goes here
  4. // ]]>
  5. </script>
  • Hob Bramble
  • Proficient
  • Proficient
  • User avatar
  • Posts: 351
  • Loc: Indiana, USA

Post 3+ Months Ago

One other thing that's caught me several times is capitalization: If you're using an HTML document, then it doesn't matter, but in an XHTML document, you have to make sure that all of your JavaScript is in lower-case (even though JavaScript is usually mixed-case), otherwise it won't validate (as valid XHTML is all lower-case).
  • thesquareone
  • Novice
  • Novice
  • thesquareone
  • Posts: 23

Post 3+ Months Ago

hi thanks for that :) unfortunatly it still registers as non w3 validated, i actually had it in lower case to start with so all i added was the

// <![CDATA[

// ]]>

any other suggestions, you can see for yourself over here http://validator.w3.org/check?uri=http% ... s.co.uk%2F
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6243
  • Loc: Seattle, WA

Post 3+ Months Ago

You're getting the errors because your <script> block should be placed within your <head> element, but it is not.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Code: [ Select ]
<head>
<script type="text/javascript">
// <![CDATA[
 
Code goes here
 
// ]]>
</script>
</head>


<body>
<script type="text/javascript">
// <![CDATA[
 
Code goes here
 
// ]]>
</script>
</body>
  1. <head>
  2. <script type="text/javascript">
  3. // <![CDATA[
  4.  
  5. Code goes here
  6.  
  7. // ]]>
  8. </script>
  9. </head>
  10. <body>
  11. <script type="text/javascript">
  12. // <![CDATA[
  13.  
  14. Code goes here
  15.  
  16. // ]]>
  17. </script>
  18. </body>
  • thesquareone
  • Novice
  • Novice
  • thesquareone
  • Posts: 23

Post 3+ Months Ago

well thank you very much for that :) its sometimes the simple things i guess you miss :)

many thanks indeed

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 63 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.