【发布时间】:2012-04-03 11:38:28
【问题描述】:
当使用 fb.UI https 托管 iframe 页面时,会提供适当的模式对话框,但通过 http 的同一页面会弹出窗口
这是我的代码,主要来自 facebook 对话框帮助页面:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>My Feed Dialog Page</title>
</head>
<body>
<p>oh, hello.</p>
<div id='fb-root'></div>
<script src='//connect.facebook.net/en_US/all.js'></script>
<p><a onclick='postToFeed(); return false;'>Post to Feed</a></p>
<p id='msg'></p>
<script>
FB.init({appId: "myappid", status: true, cookie: true});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
link: 'http://www.facebook.com/testapp/app_myappid/',
picture: 'http://fbrell.com/f8.jpg',
name: 'Facebook Dialogs',
caption: 'Reference Documentation',
description: 'Using Dialogs to interact with users.',
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
</script>
</body>
</html>
所以当我通过https://www.facebook.com/testapp/app_myappid 访问该页面时,我得到了一个正确的模态对话框,但http://www.facebook.com/testapp/app_myappid 给出了一个可怕的弹出窗口。
【问题讨论】:
标签: javascript facebook https