开发者

HTML5 assumed Mime Types

开发者 https://www.devze.com 2023-03-09 14:32 出处:网络
I\'ve been experimenting with HTML5 lately, and found it of interest that when adding javascript to pages, 开发者_JAVA技巧you no longer need to declare the scripting language as you did previously. It

I've been experimenting with HTML5 lately, and found it of interest that when adding javascript to pages, 开发者_JAVA技巧you no longer need to declare the scripting language as you did previously. It assumes that javascript is being used unless you specifically declare another language with a mime type.

OLD: <script type="text/javascript"> // Do Something </script>

NEW: <script> // Do Something </script>

What I'm wondering is if HTML5 assumes other mime types as well - for including css or favicons, etc.

Anyone know where I could find more info on this?


http://www.w3.org/TR/html5/obsolete.html looks like it sums them all up fairly well.


You can also drop the type attribute in a stylesheet link. Just use:

<link rel="stylesheet" href="style.css" />

without type="text/css".

Dive into HTML5 by Mark Pilgrim contains a chapter covering this sort of subject.

0

精彩评论

暂无评论...
验证码 换一张
取 消