我遇到了与facebook的JavaScript客户端应用程序授权问题。下面的代码按照期望的方式工作,当应用程序未被授权,应用程序授权弹出窗口出现当相同的代码在codeignigter中运行时,授权对话框将无法显示。Facebook客户端应用程序授权codeigniter
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
// Init the SDK upon load
window.fbAsyncInit = function() {
FB.init({
appId : '169550646480230', // App ID
channelUrl : '//'+window.location.hostname+'/channel', // Path to your Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
请发布服务器端代码和更多的HTML。 – 2012-04-18 14:25:48