我使用Facebook的演示脚本来了解注册插件的系统。我使用这段代码:
<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 :(得分:0)
我认为您需要使用HTTPS:
<script src="https://connect.facebook.net/en_US/all.js#appId=285180546708&xfbml=1"></script>