Ski*_*ick 24 jquery google-chrome
.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>
Run Code Online (Sandbox Code Playgroud)
<h1>Loaded successfully</h1>
Run Code Online (Sandbox Code Playgroud)
这适用于Firefox和IE,但在Chrome上它#reader
没有任何内容替换div 的内容.
编辑:我应该补充一点,我在本地运行它,它永远不会部署在Web服务器上.
编辑2:我尝试过.load('file:///C:/path/to/test.htm')
在FF中运行但不是Chrome.
Ken*_*ler 20
这是Chrome解释的"同源策略"(或具有相同效果的错误).尝试使用Chrome运行--allow-file-access-from-files
.
归档时间: |
|
查看次数: |
39847 次 |
最近记录: |