我只是好奇在标头中使用带有脚本和样式标签的(缩小版本的)javascript和css与通过指向css的链接和指向javascript的脚本将它们从单独的文档中包含它们是否有任何优势?
由于会有额外的页面请求,理论上不是第二种方式增加了页面加载时间吗?
所以这:
<head>
<script>
//Javascript
</script>
<style>
//Css
</style>
</head>
<body>
//Content Here
</body>
</html>
与此:
<head>
<script src='http://someJavascript.com/link/to/file.js' type='text/javascript'></script>
<link href='http://someCSS.com/link/to/file.css' rel='stylesheet'>
</head>
<body>
//Content Here
</body>
</html>