Cannot load XML in Chrome with JQuery
Why does the following code work in firefox and not chrome? I'm testing this locally.
Thanks.
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
$('#test').load('todo.xml');
});
</开发者_如何学JAVAscript>
</head>
<body>
<div id="test">
</div>
</body>
</html>
Chrome does not allow access to local files by default. You can get around this feature by starting Chrome from the command line:
chrome.exe --allow-file-access-from-files
Check out Nick Craver's answer for more details.
精彩评论