none
<script language="JavaScript"> or <script type="text/javascript"> ?

    Question

  • When embedding JavaScript in ASP.NET/HTML, what are the differences between the following codes, if any?
    Thursday, May 07, 2009 2:35 PM

Answers

  • <script language="JavaScript"> is deprecated as "language" value is an identifier which has no standards.

    type="text/javascript" is the correct syntax. This overrides the default scripting language.
    • Marked as answer by Wonjartran Tuesday, May 12, 2009 12:58 PM
    Friday, May 08, 2009 2:38 AM

All replies

  • <script language="JavaScript"> is deprecated as "language" value is an identifier which has no standards.

    type="text/javascript" is the correct syntax. This overrides the default scripting language.
    • Marked as answer by Wonjartran Tuesday, May 12, 2009 12:58 PM
    Friday, May 08, 2009 2:38 AM
  • type = content-type

        This attribute specifies the scripting language of the element's contents and overrides the default scripting language. The scripting language is specified as a content type (e.g., "text/javascript" ). We have to supply a value for this attribute. There is no default value for this attribute.


    language ="JavaScript"

    This attribute specifies the scripting language of the contents of this element. Its value is an identifier for the language, but since these identifiers are not standard, this attribute has been deprecated(outdated by newer constructs) in favor of type.
    • Proposed as answer by sanjaybasak Tuesday, July 28, 2009 10:16 AM
    Tuesday, July 28, 2009 10:14 AM