Moving .JS files to a CDN: How to manage AJAX requests?
- by pagewil
I am thinking of moving my static .JS files to a CDN such as Amazon S3 for performance reasons. As my PHP files and mySQL DB remain on my primary hosting domain what is the best way to manage my JS AJAX requests if they are now cross domain?
Currently they look like this within my .JS file (with relative paths):
$.ajax({
type: "POST",
url: "/myNearbyPhpFile.php",
data: {data:someData},
success: function($r){}
});