/    Sign up×
Community /Pin to ProfileBookmark

I’m getting these two javascript errors upon validation…

1.

Line 9, Column 33: required attribute “type” not specified
<script src=”lite_validation.js”></script>

The attribute given above is required for an element that you’ve used, but you have omitted it. For instance, in most HTML and XHTML document types the “type” attribute is required on the “script” element and the “alt” attribute is required for the “img” element.

Typical values for type are type=”text/css” for <style> and type=”text/javascript” for <script>.

2.

Line 40, Column 7: required attribute “type” not specified
<style>

The attribute given above is required for an element that you’ve used, but you have omitted it. For instance, in most HTML and XHTML document types the “type” attribute is required on the “script” element and the “alt” attribute is required for the “img” element.

Typical values for type are type=”text/css” for <style> and type=”text/javascript” for <script>.

What do they mean?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@corics15Mar 21.2011 — it means that you have to specify a type for the <script> tag such as type='text/javascript' to define a client-side script, such as a JavaScript.

the type attribute is required and it may contain an external file through the src attribute also.

example for a script pointing to an external file:

<script type="text/javascript" src="myfunction.js"></script>

and without an external file:

<script type="text/javascript">

myfunction() {

.....

}

</script>

the same goes with the style tag, the type is also a required attribute:

<style type="text/css">

.mystyle {

.....

}

</style>

hth
Copy linkTweet thisAlerts:
@mrhooMar 21.2011 — If you use <!doctype html> you don't need the type for style or script tags, but alt is always required for valid img tags.

Different doctypes have different validation requirements.
Copy linkTweet thisAlerts:
@KorMar 21.2011 — If you use <!doctype html> you don't need the type for style or script tags, [/QUOTE]
Not really. There is no need of the [B]type[/B] [I]only[/I] in case of JavaScript codes, as JavaScript type is the default in HTML5. Otherwise, if the document uses other client-side scripting language (VBScript, AppleScript, etc), the [B]type[/B] is a must.
Copy linkTweet thisAlerts:
@mrhooMar 21.2011 — Sorry about that- I meant that the [B]validator[/B] for html(5) does not require a type attribute on script and style tags. Thanks, Kor.
×

Success!

Help @javanoob38 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...