开发者

HTML5 assumed Mime Types

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜