How to solve XMLHttpRequestcannotloadfile ~~~~~~~ Origin & #39; nu

Source: Internet
Author: User
When the framework is used at the nearest possible time, the .html file and. the following error occurs when the json file is stored: as soon as the analysis fails, I guess it is loading. json file. Previously, when I was working in a kind community, I had access to Easyui and json. At that time, I converted the data in the datatable returned from the database to json.

When errors are at the most recent frame, the. html file and. the following error occurs when the json file is stored: as soon as the analysis fails, I guess it is loading. json file. Previously, when I was working in a kind community, I had access to Easyui and json. At that time, I converted the data in the datatable returned from the database to json.

Error


When the framework is at the very beginning, the following error occurs when the. html and. json files are stored:



Analysis


When this error occurs, I guess it is loading. json file. Previously, when I was working in a kind community, I had access to Easyui and json. At that time, I converted the data in the datatable returned from the database into json data, then it is loaded into the table. Therefore, I first thought of the reason for the json data format. This error still occurs after the json data format was changed in the kind community. When I write the data in the. json file to the Code, the load is normal. Therefore, this is not the reason for json data format.


Cause


This makes me have to think about whether it is another reason. Later, I found the reason through some queries.

The reason is as follows:

Hosts file.


Solution


Enable Chrome shortcut settings:

Right-click the Chrome shortcut and select "properties ",

Add "-- allow-file-access-from-files" to the "target". Note that there is a space in front,

Restart Chrome.

In this way, the load is normal.

Summary


You must understand debugging when creating a project. You cannot seek help when you encounter any errors. First, you must learn how to solve the problems by yourself, analyze the errors, troubleshoot the errors one by one, and finally find the cause of the errors, then the remaining solution is not a big problem.

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.