开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜