2011-09-30 103 views
0

我使用Facebook的演示腳本來了解註冊插件的系統。我用這個代碼:xfbml註冊插件驗證錯誤

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

<div id="fb-root"></div> 

<script src="http://connect.facebook.net/en_US/all.js#appId=285180546708&xfbml=1"></script> 

<fb:registration redirect-uri="http://basarozcan.com/store_userdata.php" 
    fields='[{"name":"name"}, 
      {"name":"username","description":"Username","type":"text"}]' 
    onvalidate="validate_async"></fb:registration> 

<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> 
<script> 
    function validate_async(form, cb) { 
     $.getJSON('validate.php?username=' + form.username, 
    function (response) { 
     if (response.error) { 
      // Username isn't taken, let the form submit 
      cb(); 
     } 
     cb({ username: 'That username is taken' }); 
    }); 
    } 
</script> 

</body> 
</html> 

我打開網頁,寫用戶名,但腳本無法驗證用戶名和Firebug的顯示錯誤。錯誤是:

Permission denied to access property 'Arbiter' 
if (p == parent || !p.Arbiter || !p.JSON) { 

我該如何解決這個問題? 感謝

回答

0

我認爲你需要使用HTTPS:

<script src="https://connect.facebook.net/en_US/all.js#appId=285180546708&xfbml=1"></script>