Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Difference between script LANGUAGE and script type

Erin EnglandErin England DallasMember Posts: 1
edited September 2015 in JavaScript

What is the difference between script LANGUAGE and script type when writing JavaScript?

Comments

  • B00B00 Member Posts: 111 ✭✭✭

    I assume you're speaking of HTML tag <script type='text/javascript'>.

    language attribute identifies the scripting language in use. Unlike the type attribute, however, this attribute's possible values were never standardized. The type attribute should be used instead.

    type attribute identifies the scripting language of code embedded within a script element or referenced via the element’s src attribute. This is specified as a MIME type; examples of supported MIME types include text/javascript, text/ecmascript, application/javascript, and application/ecmascript. If this attribute is absent, the script is treated as JavaScript.

    Note: The type attribute is required in HTML 4, but optional in HTML5.

Sign In or Register to comment.