Ajax request subdomain
Is there a way to get ajax requests from http://foobar.com to snatch data from pages such as http://sub1.foobar.com/choco.php ?
It seems subdomain 开发者_如何学JAVArequests are still not allowed via javascript
If the data is not sensitive, you may use JSONP (JSON with Padding) as an alternative.
http://en.wikipedia.org/wiki/JSON#JSONP
JSONP (as Andrew mentioned) or a Proxy Script.
You may use the Access-Control-Allow-Origin
header for modern browsers, and wrap the request on the local domain for antique browsers.
精彩评论