How to configure addthis so that it won't create the hash data in the URL that I am going to share?

早过忘川 提交于 2019-12-21 15:26:45

问题


When I share a page, addthis creates some data/ infomation after my share URL with a hash(#) - how I can configure addthis so that it won't create the hash data in the URL that I am going to share?

For instance, addthis makes these,

http://mywebsite.com/#.Ufs8RtZRjpU.facebook
http://mywebsite.com/#.Ufs8oc2zPtQ.twitter

I am after,

http://mywebsite.com/
http://mywebsite.com/

Is it possible?

edit:

<!-- AddThis Button BEGIN -->
<script type="text/javascript">var addthis_config = { pubid: "lauthiamkok", data_track_addressbar:false };</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=lauthiamkok"></script> 
<!-- AddThis Button END -->

<script type="text/javascript">
var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
</script>

Tried this but does not work. Addthis is still a pain after years using it!


回答1:


I think what you're wanting to disable is clickback tracking, and in your question you're trying to disable address bar tracking. Try this instead:

var addthis_config = {
       data_track_clickback: false 
}

Found this here.




回答2:


I found this: http://support.addthis.com/customer/portal/questions/352733-how-to-remove-hash-from-url-

<script type="text/javascript">
var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
</script>

Okay try moving the add_config line above the widget

<script type="text/javascript">
var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
</script>

<!-- AddThis Button BEGIN -->
<script type="text/javascript">var addthis_config = { pubid: "lauthiamkok", data_track_addressbar:false };</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=lauthiamkok"></script> 
<!-- AddThis Button END -->



回答3:


I have created a JavaScript function and used it on load....

 function onloader() {
            var v = window.location.href;
            v = v.replace(/\#.*/, '');
            window.location.href.replace = v;
        }
        $(window).load(function () {
            onloader();
        });

that did work for me... :) hope that will work for every one :D



来源:https://stackoverflow.com/questions/18009131/how-to-configure-addthis-so-that-it-wont-create-the-hash-data-in-the-url-that-i

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!