.load()可以正常工作,但由于某种原因,它现在不在Chrome中(可能是某种更新)。我使用的是Chrome 5.0.375.55。我将问题隔离到此:
索引
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#reader').load('test.htm');
});
</script>
</head>
<body>
<div id='reader'>Loading ...</div>
</body>
</html>
测试文件
<h1>Loaded successfully</h1>
这在Firefox和IE上有效,但在Chrome上却完全取代了#readerdiv 的内容。
编辑:我应该补充一点,我正在本地运行它,并且永远不会在Web服务器上部署它。
Edit2:我已经试过.load('file:///C:/path/to/test.htm')了FF,但不能在Chrome中使用。
眼眸繁星
jeck猫
杨__羊羊
相关分类