Search code examples
phpjavascriptfacebookxfbml

Why does the XFBML registration plugin go blank when used in IE?


I think I might be doing something wrong. Users that try and register with Internet Explorer say that the facebook plugin goes blank when trying to submit it. Any Ideas?

This is some of the code:

    <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


Solution

  • If you're using XHTML the most common problem is that the Facebook namespace isn't included in the HTML tag. This is the normal reason IE doesn't render FBML.

    Your HTML tag will look like:

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

    This is part of the Legacy API.