开发者

JavaScript XHR w/ GitHub API

开发者_高级运维

I'm trying to use XHR to access the GitHub HTTP API, and I'm being rather badly defeated by the Same Origin Policy. I'm quite sure that easyXDM is overkill for this, but I don't know what else (if there is anything else) that I can use. Is there some easier way than easyXDM to get from my website to the GitHub API?


Turns out GitHub API supports JSON-P. from http://developer.github.com/v3/#json-p-callbacks:

You can send a callback parameter to any GET call to have the results wrapped in a JSON function. This is typically used when browsers want to embed GitHub content in web pages by getting around cross domain issues.

(emphasis mine)


This is your friend:

http://developer.github.com/v3/#cross-origin-resource-sharing

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜