开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜