Type= "Application/javascript"

Source: Internet
Author: User

Type= "Application/javascript" HTML script tag type has the following values, what is the meaning of the respective, under what circumstances to use?
    • Type= "Text/javascript"
    • Type= "Application/javascript"
    • Type= "Application/x-javascript"
What's the difference between these 3?

  1. The traditional MIME type forJavaScript programs is "Text/javascript".anothertype that have been used is"Application/x-javascript"( the"x"prefix indicates that it 's anExperimental,nonstandard type).RFC4329Standardized the"Text/javascript"type because it is in common use.however,becauseJavaScriptprograms is not really text documents,It marks ThistypeAs obsolete and recommends"Application/javascript"(without the"x") instead. at the time of ThisWriting,"Application/javascript" is notWell supported,however. thatmight is the reason why"Application/x-javascript"is used by a lot of webpages.

The general meaning is: The MIME type of the traditional JavaScript program is "Text/javascript", others use "Application/x-javascript" (The x prefix indicates that this is experimental, not the standard type), RFC4329 Specifies the "text/javascript" type , as it is commonly used. However, the JavaScript program is not a real text file, which means that this type has already meant obsolete, and it is recommended to use "Application/javascript" (remove the x prefix). However, when writing a program, "Application/javascript" is not very well supported. This is why "application/x-javascript" is not used in many Web pages.

您是否很疑惑为什么我们没有在<script>标签中使用 type="text/javascript"?

In HTML5, you don't have to do that. JavaScript is the default scripting language in HTML5 and all modern browsers!





Type= "Application/javascript"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.