Facebook的如何做跨域Ajax调用? [英] how facebook does cross domain ajax call?
问题描述
我期待着创造一个JavaScript API,它包含了大部分称Facebook的JavaScript API提供的功能。
I am looking forward to create a javascript API that contains most of the functions that facebook Javascript API provides.
FB.api
FB.init
FB.logout
FB.getLoginStatus
FB.login
FB.ui
我可以只嵌入脚本标记的远程站点,需要从该页面中的所有Ajax调用做我的服务器。我创建的体系结构,并与他/她出色的想法完成它需要有人帮助。
I can just embed script tag in remote website and need to do all the ajax calls from that page to my server. I am creating an architecture and needs someone help in finishing it with his/her excellent ideas.
推荐答案
看看的 https://github.com/facebook/facebook-js-sdk/blob/de$p$pcated/src/core/xd.js
他们使用RPC解决方法的组合(与中继文件),闪存本地连接和postMessage的,无论是支持的浏览器。
They use a combination of rpc workarounds (with a relay file), Flash Local Connection and postMessage, whichever is supported by the browser.
这篇关于Facebook的如何做跨域Ajax调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!