Moving .JS files to a CDN: How to manage AJAX requests?

Posted by pagewil on Stack Overflow See other posts from Stack Overflow or by pagewil
Published on 2011-02-24T23:10:55Z Indexed on 2011/02/24 23:25 UTC
Read the original article Hit count: 156

Filed under:
|
|
|
|

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){}
});

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript