zoukankan      html  css  js  c++  java
  • js mine 类型javascripttext/javascript,application/javascript, and appliation/xjavascript

    这两天使用iewatch观察google的网站的时候,发现学到js文件的mime类型为text/javascript,而今天在qq的网站上,使用iewatch发现,有时用text/javascript的,也有使用application/javascript的还有使用appliation/x-javascript的,所有就不太知道这三个mime 类型有什么区别,在google上一搜:

    The traditional MIME type for JavaScript programs is
    "text/javascript". Another type that has been used is
    "application/x-javascript" (the "x" prefix indicates that it is an
    experimental, nonstandard type). RFC 4329 standardized the
    "text/javascript" type because it is in common use. However, because
    JavaScript programs are not really text documents, it marks this type
    as obsolete and recommends "application/javascript" (without the "x-")
    instead. At the time of this writing, "application/javascript" is not
    well supported, however. That might be the reason why
    "application/x-javascript" is used by a lot of webpages.

    大致意思是:传统的javascript程序的MIME类型是“text/javascript”,其他使用的还有"application/x-javascript"(x前缀表示这是实验性的,不是标准的类型),RFC4329规定了“text/javascript”类型,因为它普遍被使用。然而,javascript程序并不是真正的文本文件,这就表示这个类型已经意味着过时了,而推荐使用"application/javascript"(去除x前缀)。然而,在写程序的时候,"application/javascript"没有很好的支持。这也行就是"application/x-javascript"被使用在很多网页中的原因。

  • 相关阅读:
    ExcelManager基于.Net的Excel读写管理类库(二)
    ExcelManager基于.Net的Excel读写管理类库(一)
    NHibernate初探!
    也谈软件工程!
    本人初学WCF ,请教一个问题
    初来咋到,今天终于在这里建起了一个家!
    c#中委托和直接函数调用用什么区别,好处和目的在哪?
    CreateThread, AfxBeginThread,_beginthread, _beginthreadex的区别
    C++线程同步
    C++中using的作用
  • 原文地址:https://www.cnblogs.com/seniortestingdev/p/2469687.html
Copyright © 2011-2022 走看看