0

I am checking my site through the validator tool for accessibility. I am have the following errors

The default style sheet language must be specified when style attributes are used:

The default scripting language must be specified for an intrinsic event:

I have already specify the languages but not in the meta tag. The way I specify them in my site is:

<script type="text/javascript" src='javascript_code.js'></script>
<link href="style.css" rel="stylesheet" type="text/css" />

inder the title of my site. As this is a check for a project and i will be marked my site should be at least level A WCAG compliant. Do I really have to fix these errors? Or it is just a problem of the validator because it probably does not check in other tags for this? Any idea? Thank you!!!

Community
  • 1
  • 1
anna
  • 745
  • 2
  • 9
  • 30

2 Answers2

3

Whether you specify a default scripting language is of zero practical consequence in browsers (unless you are mixing javascript with VB in IE, which is extremely rare, or some other even less common host and language), but to keep the validator happy:

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

should do the job.

Note that the text/javascript type is obsolete. You can try "application/javascript" or "application/ecmascript", but not in script elements as some browsers will then ignore the script, so use "text/javascript".

RobG
  • 142,382
  • 31
  • 172
  • 209
  • Hi! Sorry I just saw the message. Thank you for your answer. I am currently using this. So, the validator is complaining for both css and javascrict for not being in meta tag. So, can i put the three of then in the content attribute without any side effect? The syntax will be like this: ?Sorry for asking this silly question but because of lack of time I didn't chech it. – anna Apr 25 '12 at 13:41
  • [ContentType](http://www.w3.org/TR/html4/sgml/dtd.html#ContentType) (singular) must have a single value. [ContentTypes](http://www.w3.org/TR/html4/sgml/dtd.html#ContentTypes) (plural) may have a comma separated list of content types. Where the META element specifies the default scripting language, only one type is allowed. Same for the [default style sheet language](http://www.w3.org/TR/html4/present/styles.html#h-14.2.1). So you need one META element for each. – RobG Apr 25 '12 at 22:52
0

When intrinsic events (onclick, onmouseover etc) are specified the default scripting language should be specified using a Content-Script-Type HTTP header or tag.

See http://www.w3.org/TR/html401/interact/scripts.html#h-18.2.2.1

When style attributes are used the default style sheet language should be specified using a Content-Style-Type HTTP header or tag.

See http://www.w3.org/TR/html401/present/styles.html#h-14.2.1

lakshmi priya
  • 159
  • 11