社交分享按钮错误

时间:2017-04-06 11:29:13

标签: javascript html google-plus social socialshare

这是CSS代码:

<style>
.fa-google {
  background: #dd4b39;
  color: white;
}
.fa {
  padding: 20px;
  font-size: 30px;
  width: 30px;
  text-align: center;
  text-decoration: none;
  margin: 5px 2px;
  border-radius: 50%;
}
</style>

这是捕获当前网址并显示它的按钮和JavaScript:

<a class="fa fa-google" href="javascript:fbCurrentPage()" target="_blank" alt="share this page"></a>
    <script>
    var url = window.location.href; //Captures the current url


    function fbCurrentPage() {
        window.open('https://plus.google.com/share'+escape(window.location.href)+'&text='+document.title + ' via : ' + url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600');
        return false; 
    }
    </script>

这是谷歌的错误:

  

enter image description here

0 个答案:

没有答案
相关问题