我有一个包含以下内容的 html 文件:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.3.js" />
</head>
<body>
<script type="text/javascript">
alert("Hello");
</script>
<h1>Test</h1>
</body>
</html>
当我直接从文件系统在 Firefox 中打开它时,输出是
<html>
<head>
<script src="http://code.jquery.com/jquery-2.0.3.js" type="text/javascript">
it loads the script here
</script>
</head>
<body>
<h1>Test</h1>
</body>
我想知道为什么脚本标签没有加载到正文中。
如果我的 jquery 源来自 google cdn,它会加载脚本:
http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
我没有在任何地方托管此页面。只是尝试一些 jQuery 的东西,发现了这个问题。