Unable to load XML in Chrome using jQuery

Why does the following code work in firefox and not in chrome? I am testing this locally.

Thank.

<html>
    <head>

        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript">
            $(function(){
                $('#test').load('todo.xml');
            });
        </script>

    </head>
    <body>
        <div id="test">
        </div>
    </body>
</html>
+3
source share
1 answer

Chrome does not allow access to local files by default. You can get around this feature by running Chrome from the command line:

chrome.exe --allow-file-access-from-files

Check out Nick Craver's answer for more details.

+2
source

Source: https://habr.com/ru/post/1782180/


All Articles