Using Ajax to request local files, chrome will report cross domain error: XMLHttpRequest cannot LoadFile:///C/users/Li/desktop/images/alist.json.cross origin requests are only supported for protocol schemes: http, data, Chrome extension, HTTPS, Chrome extension resource
solution:
Add a startup parameter to chrome: — allow file access from files
specific method:
Right-click the browser shortcut – properties – Shortcut – target, as shown in the figure below:
Similar Posts:
- Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extensi…
- Solve the certificate problem of Chrome 70 and above: Failed to load resource: net::ERR_CERT_SYMANTEC_LEGACY
- Solution to cross origin read blocking (CORB) blocked cross origin response error
- Provisional headers are shown
- JQuery Ajax crossdomain cannot be used in IE [How to Solve]
- Solutions to axis RP extension for chrome problems
- Access to XMLHttpRequest at ‘http://localhost:9990/’ from origin ‘http://IP:Port’ has been blocked by CORS policy…more-private address space `local`
- Uncaught DOMException: Blocked a frame with origin “null” from accessing a cross-origin…
- Chromedriver executable needs to be in path [How to Solve]
- Sublime run code – open in browser shortcut key settings