Вопрос

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!!!

Это было полезно?

Решение

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".

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top