开发者

Cannot load XML in Chrome with JQuery

开发者 https://www.devze.com 2023-02-01 10:15 出处:网络
Why does the following code work in firefox and not chrome? I\'m testing this locally. Thanks. <html>

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

精彩评论

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