javascript non w3 compliant

  • thesquareone
  • Novice
  • Novice
  • No Avatar
  • Joined: Jul 09, 2008
  • Posts: 23
  • Status: Offline

Post July 21st, 2008, 8:13 am

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 21st, 2008, 8:13 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 21st, 2008, 8:22 am

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>
Strong with this one, the sudo is.
  • Hob Bramble
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jan 21, 2004
  • Posts: 351
  • Loc: Indiana, USA
  • Status: Offline

Post July 21st, 2008, 12:34 pm

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).
-Patrick J. B. Simmons | @hobbramble
"If I could give you one piece of advice to remember for the rest of your life, it would be this: when Patrick tells you to do something, do the opposite." - Nolan Ladewski
  • thesquareone
  • Novice
  • Novice
  • No Avatar
  • Joined: Jul 09, 2008
  • Posts: 23
  • Status: Offline

Post July 22nd, 2008, 9:29 am

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
  • Joined: Sep 22, 2003
  • Posts: 6130
  • Loc: Seattle, WA
  • Status: Offline

Post July 22nd, 2008, 9:30 am

You're getting the errors because your <script> block should be placed within your <head> element, but it is not.
The Beer Monocle. Classy.
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post July 22nd, 2008, 9:52 am

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>
Strong with this one, the sudo is.
  • thesquareone
  • Novice
  • Novice
  • No Avatar
  • Joined: Jul 09, 2008
  • Posts: 23
  • Status: Offline

Post July 22nd, 2008, 10:29 am

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 119 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.