wviewweather.com Forum Index wviewweather.com
wview and Weather Topics
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Working HTML comments!!

 
Post new topic   Reply to topic    wviewweather.com Forum Index -> Web Sites and HTML Templates
View previous topic :: View next topic  
Author Message
chrisale



Joined: 09 Nov 2005
Posts: 187

PostPosted: Wed Feb 08, 2006 10:50 pm    Post subject: Working HTML comments!! Reply with quote

A while back I was on Marks case cuz wview uses <!-- for it's tags... which is the same as what HTML uses for comments... meaning it's very hard to do comments in your HTML code, and... if you have any javascript, very hard to make your code VALID to strict XHTML standards.

Well, today, someone more XHTML savvy than me enlightened me to another way to comment XHTML code.
Instead of:
Code:

<!--

-->


Use this:

Code:
<![CDATA[

]]>


Why do I care? Well, I'm a stickler for using the HTML validator. http://validator.w3.org

And I have a personal goal to make every page that I create, valid to the Strict XHTML standard.

The only thing standing in my way was the Javascript. Inline Javascript code cannot be validated... to get around this, you usually comment it out like so:
Code:

<script type="text/javascript">
//<!--
Your Javascript
Code Here
//-->
</script>


But of course wview gets rid of those comments... opening up the javascript and annoying the validator...

Sooo, we use the XML style "CDATA" comments above.

Now everyone is happy!

YAY!
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    wviewweather.com Forum Index -> Web Sites and HTML Templates All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group