Configure Chrome to support local (file protocol) AJAX requests

Source: Internet
Author: User

Configure Chrome to support local (file protocol) Ajax request URLs: Configure Chrome to support local (file protocol) AJAX requests

When the HTML code is dragged into Chrome through the file protocol, the AJAX request local file will report a cross-domain error.
XMLHttpRequest cannot load file:///E:/webs/extJS/ext-3.3.0/examples/csdn/combobox.txt?_dc=1414738973999.
Cross origin requests is only supported for protocol schemes:http, data,
Chrome-extension, HTTPS, Chrome-extension-resource.


The workaround is to add a boot parameter to Chrome:--allow-file-access-from-files so that local AJAX requests do not report cross-domain errors.
(Note that if you add multiple startup parameters to Chrome, each startup parameter "--" should be separated by a space,
such as "C:\Program Files\google\chrome\application\chrome.exe"--enable-file-cookies--allow-file-access-from-files)

How to add Chrome boot parameters to support AJAX requests under the file protocol,
See this: Chrome can't save the local settings cookie solution

After you have added the--allow-file-access-from-files startup parameters,
The local file load file can also be resolved, causing the IFRAME and parent pages to be inaccessible to each other.
Window.Open open page Using opener null problem, refer to: Chrome local test access Iframe,parent,opener null workaround

......................................................................................................................... ........................... From the Internet

Configure Chrome to support local (file protocol) AJAX requests

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.