Chrome and --allow-file-access-from-files

后端 未结 2 1627
失恋的感觉
失恋的感觉 2021-01-24 00:09

I have a jquery/AJAX sign in page that works perfectly in all browsers except Chrome. It seems I have bumped into an issue in Chrome which is covered at Problems with jQuery ge

相关标签:
2条回答
  • 2021-01-24 00:58

    This should only a problem if you are trying to use Chrome to load files from your local file system. This is because Chrome has a insanely restrictive AJAX policies on the filesystem.

    Essentially, Chrome does not allow AJAX requests to files outside the html page's folder. To fix this, just serve your files from a web server. Your site visitors are probably going to access your site through a web server anyway, so this should not be a problem to them.

    0 讨论(0)
  • 2021-01-24 01:08

    Don't use that flag. You're opening your machine or your users machines to attacks. Instead run a local server. It's as easy as opening a shell/terminal/commandline and typing

    cd path/to/files
    python -m SimpleHTTPServer
    

    Then pointing your browser to

    http://localhost:8000
    

    If you find it's too slow consider this solution

    0 讨论(0)
提交回复
热议问题