Facebook JavaScript SDK 意外行为

发布于 2024-11-30 12:17:52 字数 650 浏览 1 评论 0原文

这是m代码:

<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId  : '270423476xxxxx',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml  : true  // parse XFBML
});
</script>

<fb:registration 
fields="name,birthday,gender,location,email" 
redirect-uri="http://booktrolley.in/beta"
width="530">

现在,如果您转到我的页面:http://www.booktrolley.in/beta/fbreg。 php

即使在页面加载之后,这个“正在加载”动画仍然存在。为什么会这样?

谢谢

Here's m code :

<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId  : '270423476xxxxx',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml  : true  // parse XFBML
});
</script>

<fb:registration 
fields="name,birthday,gender,location,email" 
redirect-uri="http://booktrolley.in/beta"
width="530">

Now if you go to my page on : http://www.booktrolley.in/beta/fbreg.php

There's this "Loading" animation that continues to be there, even after the page loads.Why is that so ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

祁梦 2024-12-07 12:17:53

这就是古埃及人所说的“虫子”

This is what the ancient Egyptians called "a bug"

你丑哭了我 2024-12-07 12:17:52

您正在框架中加载插件,但页面的 HTML 结构不正确,这里有一个更好的方法:

<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head></head>
<body>
<div id="fb-root" > </div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {

var wid=$(document).width()-20;
    $("#fb").attr('width',wid);

    });
  FB.init({
    appId  : 'XXXXXXXXXXX',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true  // parse XFBML
  });
</script>
<fb:registration redirect-uri="http://booktrolley.in/" 
 fields='[
   {"name":"name"},
   {"name":"foo","description":"Type foo","type":"text"},
   {"name":"bar","description":"Type bar","type":"text"},
   {"name":"facebooker","description":"Pick Paul","type":"select","options":
     {"coder":"Paul","pm":"Austin","partners":"Cat"}},
   {"name":"check","description":"Check this","type":"checkbox"},
   {"name":"date","description":"Dec 16 2010","type":"date"},
   {"name":"city","description":"Calgary","type":"typeahead","categories":
     ["city"]}]' 
 onvalidate="validate"></fb:registration> 

<script> 
function validate(form) {
  errors = {};
  if (form.foo !== "foo") {
    errors.foo = "You didn't type foo";
  }
  if (form.bar !== "bar") {
    errors.bar = "You didn't type bar";
  }
  if (form.facebooker !== "coder") {
    errors.facebooker = "Pick the geeky one";
  }
  if (!form.check) {
    errors.check = "Check the little box";
  }
  if (form.date !== '12/16/2010') {
    errors.date = "That isn't the launch date";
  }
  if (form.city.id !== '111983945494775') {
    errors.city = "That isn't Calgary, Alberta";
  }
  return errors;
}
</script>
</body>
</html>

You are loading the plugin in a frame but your page's HTML structure is not correct, here's a better approach:

<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head></head>
<body>
<div id="fb-root" > </div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {

var wid=$(document).width()-20;
    $("#fb").attr('width',wid);

    });
  FB.init({
    appId  : 'XXXXXXXXXXX',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true  // parse XFBML
  });
</script>
<fb:registration redirect-uri="http://booktrolley.in/" 
 fields='[
   {"name":"name"},
   {"name":"foo","description":"Type foo","type":"text"},
   {"name":"bar","description":"Type bar","type":"text"},
   {"name":"facebooker","description":"Pick Paul","type":"select","options":
     {"coder":"Paul","pm":"Austin","partners":"Cat"}},
   {"name":"check","description":"Check this","type":"checkbox"},
   {"name":"date","description":"Dec 16 2010","type":"date"},
   {"name":"city","description":"Calgary","type":"typeahead","categories":
     ["city"]}]' 
 onvalidate="validate"></fb:registration> 

<script> 
function validate(form) {
  errors = {};
  if (form.foo !== "foo") {
    errors.foo = "You didn't type foo";
  }
  if (form.bar !== "bar") {
    errors.bar = "You didn't type bar";
  }
  if (form.facebooker !== "coder") {
    errors.facebooker = "Pick the geeky one";
  }
  if (!form.check) {
    errors.check = "Check the little box";
  }
  if (form.date !== '12/16/2010') {
    errors.date = "That isn't the launch date";
  }
  if (form.city.id !== '111983945494775') {
    errors.city = "That isn't Calgary, Alberta";
  }
  return errors;
}
</script>
</body>
</html>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文