Echarts code:
The code is as follows: |
Copy code |
Require ('echarts/util/mapData/params '). params. continent = { GetGeoJson: function (callback ){ $. GetJSON ('./scripts/continent_geo.json', callback ); } } |
Figure:
Specified ed an invalid response. Origin 'null' is therefore not allowed access.
After changing to an absolute path, it is like this:
Cross origin requests are only supported for HTTP
Google:
Chrome does not open http requests to local files based on security considerations, so it is unknown for IE and Firefox support.
There are some solutions on the Internet, but none of them succeeded.
Add startup parameters to chrome:
The code is as follows: |
Copy code |
-- Allow-file-access-from-files Or -- Disable-web-security |
Add the startup parameter method to chrome:
Google Chrome shortcut, right-click Properties and add startup parameters to the target location
C: \ Users \ xxx \ AppData \ Local \ Google \ Chrome \ Application \ chrome.exe -- disable-web-security
None of the above two methods can be used.
The best way is to put the folder on the http server for testing. A better way to contact us.