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:
1 2 3 |
header("Access-Control-Allow-Origin: *"); |
Don’t forget to enable mod_headers module in httpd.conf
Source: jQuery AJAX cross domain