Vlad Jula-Nedelcu
Vlad Jula-Nedelcu

Reputation: 1696

Facebook registration plugin doesn't seem to be working on IE7/8

I'm using the registration plugin of facebook to manage registration of some site. It works in all browsers except in IE7/8.

In IE8, it gives some javascript error like 'tagName' is null or not an object zRlOgpwX8LW.js, line 31 character 492.

You can see below the whole html code of the page. So far the only thing i manage to figure out is that the presence of "onvalidate" attribute generates the error. If i remove it, everything works just fine.

Did anyone else encountered this? How did you manage to fix it?

Thanks

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>

    <script type="text/javascript" src="/js/jquery/jquery-1.4.2.min.js"></script>
  </head>
  <body>
    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js"></script>

    <script type="text/javascript">

      FB.init({
        "appId": '<< my app id >>',
        "cookie": true,
        "xfbml": true
      });

      function check_username(form, cb) {
        $.getJSON('http://mysite/checkUsername?username=' + form.username+'&callback=?',
        function(response) {
          if (response.message == "ok") {
            cb();
          }

          cb({'username': response.message});
        }
        )
      }
    </script>

    <fb:registration redirect-uri="http://mysite/facebook-register-done?redirect="
      fields='[{"name":"name"},
        {"name":"first_name"},
        {"name":"last_name"},
        {"name":"email"},
        {"name":"location"},
        {"name":"birthday"},
        {"name":"username","description":"Username","type":"text"}]'
      onvalidate="check_username"></fb:registration>

  </body>
</html>

Upvotes: 2

Views: 1510

Answers (4)

Rob Vanders
Rob Vanders

Reputation: 515

Add an XML namespace to the <html> tag of your document. This is necessary for XFBML to work in earlier versions of Internet Explorer.

It also works with HTML5 if you use data-somename="somevalue" attributes on elements.

<html xmlns:fb="http://ogp.me/ns/fb#">

Upvotes: 1

Jim
Jim

Reputation: 11

Just add the FB namespace attribute to html tag:

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

Upvotes: 0

Vlad Jula-Nedelcu
Vlad Jula-Nedelcu

Reputation: 1696

From FB bugracker

------- Comment #34 From Stephen Doyle 2011-08-03 10:46:10 PDT -------
This should now be resolved. Thanks for your patience.

Upvotes: 0

Paul Tarjan
Paul Tarjan

Reputation: 50602

This is a Facebook bug. Nothing you can do. Sorry! (we are working on it)

http://bugs.developers.facebook.net/show_bug.cgi?id=15236

Upvotes: 1

Related Questions