Php Facebook邀请朋友插件不';第一次之后我就不工作了
在我集成了Facebook邀请朋友插件之后,第一次在任何浏览器中加载它时,它都可以正常工作,但当我第二次尝试它时(刷新或其他操作后),它就不再打开了。我一直在点击,但就是打不开 代码如下:Php Facebook邀请朋友插件不';第一次之后我就不工作了,php,facebook,firefox,google-chrome,facebook-opengraph,Php,Facebook,Firefox,Google Chrome,Facebook Opengraph,在我集成了Facebook邀请朋友插件之后,第一次在任何浏览器中加载它时,它都可以正常工作,但当我第二次尝试它时(刷新或其他操作后),它就不再打开了。我一直在点击,但就是打不开 代码如下: function showPopup(pageURL, title, w, h) { var left = (screen.width / 2) - (w / 2); var top = (screen.height / 2) - (h / 2); var targetWin = wi
function showPopup(pageURL, title, w, h) {
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
window.fbAsyncInit = function () {
FB.init({
// appId : 'my app id', // App ID
// channelURL : '//WWW.mydomain.COM/domainfolder/channel.php', // Channel File
status: true,
// check login status
cookie: true,
// enable cookies to allow the server to access the session
oauth: true,
// enable OAuth 2.0
xfbml: true // parse XFBML
});
// Additional initialization code here
};
// Load the SDK asynchronously
(function (d) {
var js, id = 'facebook-jssdk';
if (d.getElementById(id)) {
return;
}
js = d.createElement('script');
js.id = id;
js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
//Replace the ALL_CAPS variables with your own values
function invite() {
FB.getLoginStatus(function (response) {
if (response.authResponse) {
// logged in and connected user, someone you know
FB.ui({
method: 'fbml.dialog',
width: '750px',
fbml: '<fb:request-form target="_self" method="post" invite="true" type="Invite" content="Hey! Come join me on this site! Finally it\'s opened for us! <fb:req-choice url=\'http://www.mysite.com/site/index.php\' label=\'Accept\' />" <fb:multi-friend-selector showborder="false" actiontext="Invite friends" email_invite="true" import_external_friends="true" /> </fb:request-form>'
});
} else {
// no user session available, someone you dont know
FB.login();
}
});
}
function loaded() {
document.getElementById('FBico').src = 'img/OtherServices/fb.png';
}
函数showPopup(页面URL、标题、w、h){
左侧变量=(屏幕宽度/2)-(w/2);
变量顶部=(屏幕高度/2)-(高度/2);
var targetWin=window.open(页面URL,标题,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizeable=no,copyhistory=no,宽度='+w+',高度='+h+',顶部='+top+',左='+left);
}
window.fbAsyninit=函数(){
FB.init({
//appId:'我的应用程序id',//应用程序id
//channelURL:'//WWW.mydomain.COM/domainfolder/channel.php',//通道文件
状态:正确,
//检查登录状态
曲奇:是的,
//启用Cookie以允许服务器访问会话
真的,
//启用OAuth 2.0
xfbml:true//解析xfbml
});
//这里有额外的初始化代码
};
//异步加载SDK
(职能(d){
var js,id='facebook jssdk';
if(d.getElementById(id)){
返回;
}
js=d.createElement('script');
js.id=id;
js.async=true;
js.src=“//connect.facebook.net/en_US/all.js”;
d、 getElementsByTagName('head')[0].appendChild(js);
}(文件);
//用您自己的值替换所有_CAPS变量
函数invite(){
FB.getLoginStatus(函数(响应){
if(response.authResponse){
//已登录并已连接的用户,您认识的人
FB.ui({
方法:“fbml.dialog”,
宽度:“750px”,
fbml:“好的,所以我终于找到了答案。单击图像(facebook图标)时调用了invite()函数。因此浏览器认为这是广告,第二次没有调用invite()函数。
所以在我用一个按钮替换标签后,一切都很好,facebook邀请窗口在所有浏览器中打开,没有任何问题
顺便说一句,为什么我的问题被拒绝了?没有人能回答这个问题?嗯…你有链接到你的页面吗?nanjingnetwork.com/people.php