php
  • javascript
  • facebook
  • xfbml
  • 2011-05-06 66 views 3 likes 
    3

    我想我可能会做错事。试图向Internet Explorer注册的用户表示,尝试提交时,facebook插件会变为空白。有任何想法吗?为什么在IE中使用XFBML注册插件时会变为空白?

    这是一些代码:

    <fb:registration redirect-uri="http://friendsconnect.org/----.php" 
    fields='[{"name":"name"},{"name":"first_name"},{"name":"last_name"},{"name":"email"},{"name":"username","description":"Username","type":"text"},{"name":"password"},{"name":"gender"},{"name":"birthday"},{"name":"captcha"},]' 
    onvalidate="validate"></fb:registration> 
    
    <script> 
    function validate(form) { 
        errors = {}; 
        if (form.name == "") { 
        errors.name = "Please enter your name."; 
        } 
        if (form.username == "") { 
        errors.username = "Please enter your username."; 
        } 
        if (form.email == "") { 
        errors.email = "Please enter your email address."; 
        } 
        if (form.password == "") { 
        errors.password = "Please enter your password."; 
        } 
        if (form.gender == "") { 
        errors.gender = "Please enter your sex."; 
        } 
        if (form.birthday == "") { 
        errors.birthday = "Please enter your birthday."; 
        } 
        if (form.captcha == "") { 
        errors.captcha = "Try and enter the text in the box below."; 
        } 
        return errors; 
    } 
    </script> 
    

    enter image description here

    +0

    只需注意** XFBML **不应与遗留** FBML **混淆。阅读[this](http://developers.facebook.com/blog/post/462#fbml_roadmap)。 – ifaour 2011-05-06 08:22:41

    回答

    2

    如果你使用XHTML的最常见的问题是,Facebook的命名空间不包含在HTML标签。这是IE不呈现FBML的正常原因。

    你的HTML标记看起来像:

    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> 
    

    这是传统API的一部分。

    +0

    提交时它仍然显示白色区域,我添加了html标记 – 2011-05-06 19:13:23

    +0

    您使用的是旧API吗? – crockpotveggies 2011-05-07 07:40:23

    +0

    呃我不确定,那是什么? – 2011-05-16 00:43:54

    0

    我相信你的问题是this bug,Facebook说他们昨天修好了,虽然我没有测试过它是否修复。

    我们认为可以解决此问题。 请确保此行是在 验证功能:在 https://developers.facebook.com/docs/plugins/registration/advanced/

    errors = {};

    如果你看到的仍然是问题,你能不能 请测试例的功能和使用的链接重新打开一个例子 如果这是行不通的。

    相关问题