codehaven - php snippets - coding help
Generic filters
Exact matches only

jQuery AJAX cross domain

22nd February 2017

Jquery - Validation

jquery icon

You can control this via HTTP header by adding Access-Control-Allow-Origin. Setting it to * will accept cross-domain AJAX requests from any domain.

Using PHP it’s really simple, just add the following line into the script that you want to have access outside from your domain:

Don’t forget to enable mod_headers module in httpd.conf

Source: jQuery AJAX cross domain

Was this code snippet helpful?