XHTML and validation questions
Posted: Fri Mar 24, 2006 8:39 am
Hi,
I'm reading about XHTML and want to try make some of my sites compliant in the future, therefore I've got som questions I hope some of you could help me with:
1. How do you guys include javascript, so it is both backward compatible, compatible for browsers without js and XHTML complient? The documentation says that you cannot comment it out i the HTML because parsers are allowed to strip comments. Just including them in a CDATA-block might be a problem with older browsers? What's the best to do?
2. If you use events, that are not XHTML complient the validation will pass. Can you for example attach an event using JavaScript and still call it compliant? I often use the onload event on images - how do I do include this in XHTML?
3. How strict are you, when you're coding... And in what situations? I guess it's only neccesary to comply exactly to the standard when coding for multiple devices and uses? I do for example develope a CMS only for use in IE6+, FF and other "normal" browsers - I guess it's not vital to be all strict here, or what do you think?
Hope you'll share your experience with this...
/Asger
I'm reading about XHTML and want to try make some of my sites compliant in the future, therefore I've got som questions I hope some of you could help me with:
1. How do you guys include javascript, so it is both backward compatible, compatible for browsers without js and XHTML complient? The documentation says that you cannot comment it out i the HTML because parsers are allowed to strip comments. Just including them in a CDATA-block might be a problem with older browsers? What's the best to do?
2. If you use events, that are not XHTML complient the validation will pass. Can you for example attach an event using JavaScript and still call it compliant? I often use the onload event on images - how do I do include this in XHTML?
3. How strict are you, when you're coding... And in what situations? I guess it's only neccesary to comply exactly to the standard when coding for multiple devices and uses? I do for example develope a CMS only for use in IE6+, FF and other "normal" browsers - I guess it's not vital to be all strict here, or what do you think?
Hope you'll share your experience with this...
/Asger