cod*_*ama 10 php facebook drupal fbconnect drupal-6
在右上角,它显示在此页面上:
http://www.thegreekmerchant.com/product/fokofpolisiekar/band-logo
Run Code Online (Sandbox Code Playgroud)
但不是这个
http://www.thegreekmerchant.com/
Run Code Online (Sandbox Code Playgroud)
知道为什么吗?我正在使用Drupal 6和FBConnect模块.
And*_*ist 10
实际上,问题是页面使用不同的脚本来加载FBConnect模块.
上http://www.thegreekmerchant.com/:
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : '146943825373452',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true,
logging: '0'
});
jQuery(document).trigger('fb:init');
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net//all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
Run Code Online (Sandbox Code Playgroud)
在http://www.thegreekmerchant.com/product/fokofpolisiekar/band-logo有两个剧本,前一个和下一个:
<div id="fb-root"></div><script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId: "146943825373452",
status: true,
cookie: true,
xfbml: true
});
FB.Event.subscribe("edge.create", function(href, widget) {
_gaq.push(["_trackEvent", "Facebook like", "Drupal", href]);
});
};
(function() {
var e = document.createElement('script');
e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
Run Code Online (Sandbox Code Playgroud)
我用第二个脚本替换了第一个脚本,http://www.thegreekmerchant.com/现在可以工作了(当然不是尖锐的版本,但是在我的沙盒服务器上).您只需要第二个脚本http://www.thegreekmerchant.com/product/fokofpolisiekar/band-logo.
在工作页面上,您有这个标记:
<div id="fbconnect_button-wrapper" class="form-item">
<fb:login-button v="2" background="dark" onlogin="facebook_onlogin_ready();" size="small">
<a class="fb_button fb_button_small">
<span class="fb_button_text">Facebook Connect</span>
</a>
</fb:login-button>
<div class="description">Sign in using Facebook</div>
</div>
Run Code Online (Sandbox Code Playgroud)
而在非工作方面你有这个:
<div id="fbconnect_button-wrapper" class="form-item">
<fb:login-button v="2" background="dark" onlogin="facebook_onlogin_ready();" size="small">
Facebook Connect
</fb:login-button>
<div class="description">Sign in using Facebook</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我认为,创建标记的JavaScript无法正常运行.也许在执行FB按钮脚本之前还有另一个JavaScript错误.使用Firebug或类似的工具来找出它.
没有更多信息,很难提供帮助.