3
我在玩新的Google +1按鈕,我試圖設置一個簡單的演示。Google +1按鈕腳本不在本地html文件中加載
這是我的代碼:
<html>
<head>
<title>Plus One</title>
</head>
<body>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone callback="plus_one_callback" href="http://www.testurl.com/"></g:plusone>
<!-- Place this tag after the last plusone tag -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
function plus_one_callback(){
alert('callback');
}
</script>
</body>
</html>
但是它並沒有顯示該按鈕並沒有在我的控制檯錯誤消息。
這裏是我的Firebug淨面板的screengrab:
任何人都知道爲什麼會這樣?