我想在另一个 html 页面(“index.html”)中加载一个 html 文件(“hello_world.html”),这两个文件位于同一位置。这是我写的代码。但它没有加载任何东西。两个警报都在工作(我故意给它检查 jquery 是否工作。没有其他用途)代码中的错误是什么?我不想使用ajax。
</head>
<script type="text/javascript" src="../jquery-1.3.2.js"></script>
<script type="text/javascript">
$("document").ready(function() {
alert("ya loaded");
$('#container').load('hello_world.html');
alert("finished");
});
</script>
</head>
<body>
<div id="container">
</div>
</body>