2013-03-26 57 views
0

我想在我的Google網站中包含來自ShareThis.com的一些分享按鈕。 ShareThis創建此代碼包含在頭部分:有沒有辦法改變Google網站的html head部分?

<script type="text/javascript">var switchTo5x=true;</script> 
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> 
<script type="text/javascript" src="http://s.sharethis.com/loader.js"></script> 

要讓它進入我的谷歌站點,我寫了這個程序與谷歌 - 應用程序 - 腳本並執行它:

function myFunction() { 
    var headers = {"A": "<script type=\"text/javascript\">var switchTo5x=true;</script>", 
       "B": "<script type=\"text/javascript\" src=\"http://w.sharethis.com/button/buttons.js\"></script>", 
       "C": "<script type=\"text/javascript\" src=\"http://s.sharethis.com/loader.js\"></script>"}; 

    UrlFetchApp.fetch("sites.google.com/site/mysitename/home", 
       {"headers": headers, "method": "post"}); 
} 

有沒有出現任何錯誤消息,但它在該網站的源代碼中不顯示任何結果。

有人能給我一個提示嗎?

+0

是_share this_唯一的選擇嗎?因爲有一種方法可以通過_Add this_來實現。有一個特殊的小工具可以插入_add this_選項。 – Jacobvdb 2013-04-05 23:18:41

+0

感謝您的回答,Jacobvdb。事實上,我正在使用添加它,正如您可以在我的個人資料中的Google Site上看到的那樣,但如果可能的話,我想顯示一些計數器。請告訴我你的建議。 – NULL 2013-04-13 00:02:59

回答

0

谷歌不允許在頭部分的編輯。免費服務有其限制。恥辱。我也想添加一些腳本。

相關問題