JavaScript: The Definitive Guide, Sixth Editio javaScript权威指南(第6版) pdf 文字版-文字版, javascript电子书, 和javascript 有关的电子书:

13.2.3 Script Type

13.2.3 Script Type


JavaScript was the original scripting language for the Web and

The default value of the type attribute is “text/javascript”. You can specify this type explicitly if you want, but it is never necessary.

Older browsers used a language attribute on the

The language attribute is deprecated and should no longer be used.

When a web browser encounters aelement with a type attribute whose value it does not recognize, it parses the element but does not attempt to display or execute that content. This means that you can use theelement to embed arbitrary textual data into your document: just use the typeattribute to specify a non-executable type for your data. To retrieve the data, you can use the text property of the HTMLElement object that represents the script element ( Chapter 15 explains how to obtain these elements). Note, however, that this data embedding technique only works for inline scripts. If you specify a src attribute and an unknown type, the script will be ignored and nothing will be downloaded from the URL you specified.

欢迎转载,转载请注明来自一手册:http://yishouce.com/book/1/31411.html
友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1