1

am getting the following error please help mejavascript ,

angular.min.js:103 XMLHttpRequest cannot load file:///C:/Users/DELL/Documents/jmyangularjsprojects/myangularjsprojects/login.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.(anonymous function) @ angular.min.js:103

2 Answers 2

3

I believe you are trying to run your application from your local file system, rather than using a web server. My first recommendation for you is to host the files on a web server.

If you are using Chrome, it won't let you do cross origin requests, you cannot load file:/// and instead you need to use http:// protocol at all times.

Use this workaround for chrome as a temporary fix. Find the path where you installed Chrome and do

> "C:\PathTo\Chrome.exe" --allow-file-access-from-files
Sign up to request clarification or add additional context in comments.

1 Comment

hi ..i am trying above link which is C:\C:\Users\DELL\AppData\Local\Google\Chrome\Application\chrome.exe\index.html... though it is not working as it is showing data:text/html,chromewebdata:1 Not allowed to load local resource: file:///C:/C:/Users/DELL/AppData/Local/Google/Chrome/Application/chrome.exe/....Now what can i do?
0

XMLHttpRequest can not load file means you can not parse an external data file (ex csv file). This is for security reason inside Chrome. However, to be able to download your data using d3.csv, you must follow the following steps:

  1. Open you anaconda command window (Anaconda Prompt) (test Python is working)
  2. Go to the directory where is your html file (cd xxx/xxx/xxx/index.html)
  3. Run the following command: python -m http.server (in Python 3)
  4. You will see: Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/).
  5. Open a Chrome: http://localhost:8000
  6. Then execute Ctrl + Shift I to open the development window, then click on Console to see your csv data.

This will solve your problem. Hope this will help.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.