.NET Framework Bookmark and Share   
 index > JScript for the .NET Framework > <script language="JavaScript"> or <script type="text/javascript"> ?
 

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

When embedding JavaScript in ASP.NET/HTML, what are the differences between the following codes, if any?
Wonjartran
<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 byWonjartran Tuesday, May 12, 2009 12:58 PM
  •  
Rohit S
<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 byWonjartran Tuesday, May 12, 2009 12:58 PM
  •  
Rohit S
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 bysanjaybasak Tuesday, July 28, 2009 10:16 AM
  •  
sanjaybasak

You can use google to search for other answers

Custom Search

More Threads

• jscript settatribute and event model
• How do validate my the size of a file on the client.
• call function from another file
• activating control using javascript
• Calling web method type void in javascript
• jquery intellesnese
• Use Javascript to check if client has added the domain as a Trusted Site
• Problem with using dll with <object> in ASP.NET
• How to change Image SRC in Pocket IE?
• How to draw a rectangle using Javascript?