Codeigniter: AJAX fails to access the controller: Access-Control-Allow-Origin |
I was working on a login system using Codeigniter. I tried to use AJAX to submit POST data to a controller.
Take a look at http://www.henryspike.tk/udemy When we click on Submit, the AJAX does not access the Controller and chrome returns the error: Code: XMLHttpRequest cannot load http://www.henryspike.tk/udemy/index.php/main/login. No 'Access-Control-Allow-Origin' header Please note that I installed Codeigniter in a sub directory of henryspike.tk i.e Udemy So as both the Codeigniter files and views and everything is on the same domain, why is it giving the Cross Domain error? Is it because I installed Codeigniter in a sub directory? I would like to state that I edited the base url correctly to http://www.henryspike.tk/udemy in my config.php |
Messages In This Thread |
Codeigniter: AJAX fails to access the controller: Access-Control-Allow-Origin - by henry_spike - 01-30-2017, 08:02 AM
RE: Codeigniter: AJAX fails to access the controller: Access-Control-Allow-Origin - by spjonez - 01-31-2017, 07:05 AM
RE: Codeigniter: AJAX fails to access the controller: Access-Control-Allow-Origin - by vasileios.city - 01-31-2017, 07:09 AM
RE: Codeigniter: AJAX fails to access the controller: Access-Control-Allow-Origin - by InsiteFX - 01-31-2017, 08:30 AM
RE: Codeigniter: AJAX fails to access the controller: Access-Control-Allow-Origin - by saurabh123 - 03-11-2018, 12:32 PM
|