我有在asp.net mvc3,其中有產品列表,用戶點擊一個產品時,用戶轉到另一個視圖與產品詳細信息,問題是,像facebook按鈕在頁面加載完成時不顯示。但是,如果我刷新頁面,則會顯示Google plus plus按鈕正常工作的位置。幫助PLZ。facebook喜歡的按鈕不顯示在第一個請求
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width, height=device-height,user-scalable=no" />
<title>xxxxxxxx</title>
<link href="/Content/Site.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"> </script>
<link href="/Content/JqueryContent/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<script src="/Content/JqueryContent/jquery.ui.core.js.js" type="text/javascript"></script>
<script src="/Content/JqueryContent/jquery.ui.widget.js.js" type="text/javascript"></script>
<script src="/Content/JqueryContent/jquery.ui.position.js" type="text/javascript"></script>
<script src="/Content/JqueryContent/jquery.ui.autocomplete.js" type="text/javascript"></script>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js" type="text/javascript"> </script>
</head>
<body>
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxxxxxxxx',
status : true,
cookie : true,
xfbml : true,
oauth : true,
});
FB.Event.subscribe('auth.statusChange', handleStatusChange);
};
(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>
<header data-role="header" data-theme="a"><h3>xxxxx</h3></header>
<div data-role="content">
<div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>
<style>.fb_edge_comment_widget {display: none !important; }</style>
<div class="g-plusone" data-size="medium"></div>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
</div>
<footer data-role="footer" data-theme="a" style="font-family:Trebuchet MS;"><h5></h5></footer>
</body>
</html>
您可能需要發佈一些代碼示例或提供鏈接。我不確定這是否足以回答您的問題。 – shanabus
我已添加代碼,請檢查它 –