Expert Developer JavaScript Question:
Download Questions PDF

What is the difference between script type and the script language attributes?

Expert JavaScript Developer Interview Question
Expert JavaScript Developer Interview Question

Answer:

► The script type specifies the type of content that is used to show the language used by the browsers like "language=text/javascript". This defines the MIME type that is also known as Multipurpose Internet Mail Extensions (MIME). Text in this defines a plain text format and script defines the language that will be used.
► The script language attribute on the other hand specify a particular version of JavaScript language that is required to run the script and to provide a mechanism to fall back if any browser doesn't support it.
► Script type is used to define the type through which the browser can understand the language and all the compatible browsers can execute the type according to themselves, whereas the script language attribute defines the content and its attributes that are used.

Download Expert JavaScript Developer Interview Questions And Answers PDF

Previous QuestionNext Question
What is namespacing in JavaScript and how is it used?Explain the concept of unobtrusive JavaScript?