我想在我的asp.net中使用下面的代碼,但我得到錯誤。顯示像asp.net 4.0上的facebook按鈕
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({ appId: 'xxxxxxx', status: true, cookie: true,
xfbml: true
});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('<%= fb-root.ClientID %>').appendChild(e);
}());
</script>
我得到錯誤getElementById,因爲它顯示fb不存在的錯誤。 我有一個ID爲div的div作爲fb-root。
您可以編輯您的問題以包含該div嗎? – 2011-06-10 18:50:48