我正在研究的facebook动态iFrame在Chrome和Safari中工作得很好在Internet Explorer和Firefox中存在问题,其中显示iframe但是一旦按下后退按钮就再次显示。
facebook iframe下面的代码不包含我遗漏的appId和redirect_uri。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
<script src="https://connect.facebook.net/en_US/all.js" type="text/javascript"></script>
<div id='fb-root'></div>
<script>
$(document).ready(function () {
$('#initanchor').click(function(){
window.fbAsyncInit = function() {
FB.init({
appId: '',
cookie: true,
xfbml: true,
oauth:true,
status: true });
FB.getLoginStatus(function (response) {
if (response.authResponse) {
FB.ui ( {
method: 'send',
access_token: response.authResponse.accessToken,
redirect_uri:'',
display: 'iframe',
show_error: 'true',
to: ''
});
}
});
};
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = '//connect.facebook.net/en_US/all.js';
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
});
});
</script>