XMLHttpRequest error and isAjax not work |
i am trying to make the following request with ajax but i get an error -
XMLHttpRequest cannot load https://api.domain.com/view?id=1&csrf_na...0524468477 due to access control checks. my script: Code: $.ajax({ url site: https://my.domain.com controller: PHP Code: public function view() {
I tried to add a header but it doesn't work.
there may be some special way to add a header in codeigniter 4? Help me
This is how I do it in public where index.php is .htaccess file add this.
Code: ## .htaccess Control For CORS Configuration That should work for you. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |