Submit Your Site For Free!

Email Address:
* URL:
*
*Indicates Mandatory Field

Terms & Conditions

DevWebProAU
FlashNewz
DevWebPro








Make Your Websites Completely Compliant

By Mads Kristensen
Expert Author
Article Date: 2008-12-30

I was looking at XHTML and accessibility standards for BlogEngine.NEXT and found something I haven't noticed before in the W3C specs. I came across some rules about specifying the default script and style sheet language when trying out the Total Validator.

By specifying the default script language you tell the browser what language all the onclick and other events specified in the HTML should be interpreted in. It's probably always text/javscript but it could be text/vbscript or something else.

The same goes with the style sheet type. It's always text/css when you use the style attribute in the HTML.

To tell the browser about the default script language and style sheet type, you can either add meta-tags or custom HTTP headers.

The meta-tags

<META http-equiv="Content-Style-Type" content="text/css">
<META http-equiv="Content-Script-Type" content="text/javascript">

The HTTP headers

Response.AppendHeader("Content-Style-Type", "text/css");
Response.AppendHeader("Content-Script-Type", "text/javascript");

The headers should be added to all .aspx pages. The easiest way to do that is in the master page or global.asax.

Comments

About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/




Newsletter Archive | Article Archive | Submit Article | Advertising Information | About Us | Contact

Dev Web Pro AU is an iEntry, Inc.® publication - All Rights Reserved Privacy Policy and Legal