脚本类型应用程序或文本??? [英] script type application or text ???

查看:59
本文介绍了脚本类型应用程序或文本???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两种可能性或脚本的属性类型:


text / javascript(我通常使用的那个)

application / x-javascript


两者之间有什么区别?


取决于html内容?


例如html 4.0 .1与xhtml 1.1 ???


-

UneBévue

解决方案

UneBévue写道:


text / javascript(我通常使用的那个)



不推荐使用


application / x-javascript



实验


application / javascript去年正式上市。虽然我怀疑它在浏览器支持之前会是一个

,所以它的

可能是明智的,暂时继续使用text / javascript。

(浏览器倾向于忽略

脚本的HTTP标头中的内容类型,因此转移到服务器上的application / javascript是

可能是好的未来规划)


David Dorward< do ***** @ gmail.comwrote:


已弃用


application / x-javascript



实验


应用程序/ javascript去年正式上市。虽然我怀疑它在浏览器支持之前会是一个

,所以它的

可能是明智的,暂时继续使用text / javascript。

(浏览器倾向于忽略

脚本的HTTP标头中的内容类型,因此转移到服务器上的application / javascript是

可能是好的未来计划)



好​​的,很好,很清楚,非常感谢!!!

-

Une Bévue


2月19日下午4:48,David Dorward < dorw ... @ gmail.comwrote:


application / x-javascript



实验



application / x-javascript是默认的.js文件内容类型

Microsoft IIS for at至少8年到现在。


不要与RFC#4329中的应用程序/ javascript混合 - 这就是

另一个笑话。


如果用作< scriptelement属性,那么IE都不会识别它们。

这意味着内联脚本将被默默忽略 - 这是一个很好的

因为IMO从不使用它们。

对于链接的.js文件,可以设置type =" foobar / rulez"或者什么也没设置

:自从Netscape 3.0以来忽略了src设置的type属性 - 所以

大致是永远的。


更多详细信息,请访问:

< http://groups.google.com/group/comp....avascript/msg/

39ef46cb24e69a22>


two possibilities or the attribute type of script :

text/javascript (the one i usually use)
application/x-javascript

what are the differencies between both ?

depends on the html content ?

for example html 4.0.1 versus xhtml 1.1 ???

--
Une Bévue

解决方案

Une Bévue wrote:

text/javascript (the one i usually use)

Deprecated

application/x-javascript

Experimental

application/javascript became official sometime last year. It''ll be a
while before browser support is there though I suspect, so its
probably wise to continue using text/javascript for the time being.
(Browsers tend to ignore the content type in the HTTP header for
scripts though, so moving to application/javascript on the server is
probably good future planning)


David Dorward <do*****@gmail.comwrote:

Deprecated

application/x-javascript


Experimental

application/javascript became official sometime last year. It''ll be a
while before browser support is there though I suspect, so its
probably wise to continue using text/javascript for the time being.
(Browsers tend to ignore the content type in the HTTP header for
scripts though, so moving to application/javascript on the server is
probably good future planning)

OK, fine, clear enough, thanks a lot !!!
--
Une Bévue


On Feb 19, 4:48 pm, "David Dorward" <dorw...@gmail.comwrote:

application/x-javascript


Experimental

application/x-javascript is default Content-Type for .js files on
Microsoft IIS for at least 8 years by now.

Do not mix with application/javascript from RFC #4329 - that is all
another joke.

Neither one is recognized by IE if used as <scriptelement attribute.
It means that inline scripts will be silently ignored - that''s a good
reason IMO to never use neither of them.
For linked .js files one can set type="foobar/rulez" or set nothing
at all: type attribute with src set is ignored since Netscape 3.0 - so
roughly since forever.

More details can be found at:
<http://groups.google.com/group/comp....avascript/msg/
39ef46cb24e69a22>


这篇关于脚本类型应用程序或文本???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆