Help please solve the problem with the cross-domain query. I placed the backend on one server, and the frontend on the other. Now using ajax request, the front-end script cannot retrieve data from the backend
Here is the address where you can get the data:
http://zlodiak.pythonanywhere.com/days/1497104260/1497968260 Here is my script that sends an ajax request to the above address. The ajax request is sent after the user selects the date '2017-06-01' in the first datapicer, and in the second datapicher selects the date '2017-06-30'. Then presses the submit button
As a result, the console says that the cross-domain query is not allowed:
XMLHttpRequest cannot load http://127.0.0.1:8000/days/1496264400/1498770000 . No 'Access-Control-Allow-Origin' header is present. Origin ' https://fiddle.jshell.net ' is therefore not allowed access. The response had HTTP status code 400.
I tried to have both frontend and backend on one server. In this case, all the problems described were not there and the bundle worked without problems. But I need the front end and backend to be on different servers
127.0.0.1. Register your domain explicitly. 2) Be sure to install the right headers learn.javascript.ru/xhr-crossdomain - br3t