将这个广告标签和 ID 添加到 URL - 如何删除它 [英] Addthis ads a hashtag and id to URL - how to remove it

查看:14
本文介绍了将这个广告标签和 ID 添加到 URL - 如何删除它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的 CMS 中,开发人员添加了addthis.com"脚本,该脚本将主题标签和跟踪 ID 附加到浏览器地址栏 URL,例如 http://www.site.com/about/#.UX6e2j7mK30

In our CMS the developer added an "addthis.com" script which appends a hashtag and a tracking id to the browser address bar URL, for example http://www.site.com/about/#.UX6e2j7mK30

有一个解决方案如何摆脱这种跟踪,但我们受到 CMS 的限制,它只允许我们将 javascripts 添加到页眉.addthis 脚本在页面正文中执行,我需要在默认脚本运行后以某种方式运行修复脚本.当我添加以下脚本时,修复不起作用.有什么解决办法吗?非常感谢

There is a solution how to get rid of this tracking but we are limited with CMS which only allows us to add javascripts to page header. The addthis script executes within page body and I need somehow to run the fix script after the default script has run. When I add the below script then the fix doesn't work. Is there any solution? Many thanks

<script type="text/javascript">
$(document).ready(function() {
    var addthis_config = addthis_config||{};
            addthis_config.data_track_addressbar = false;
    });
</script>

推荐答案

移除 $(document).ready 并声明 addthis_config.由于这只是定义 AddThis 的配置值,因此无需等待文档完全加载.因为您正在等待文档加载然后设置 addthis_config,所以 AddThis 代码已经运行并附加了地址栏跟踪哈希.

Remove the $(document).ready and just declare addthis_config. Since this is just defining the configuration values for AddThis, there's no need to wait for the document to fully load. Because you're waiting for the document to load and then setting addthis_config, the AddThis code has already run and appended the addressbar tracking hash.

这篇关于将这个广告标签和 ID 添加到 URL - 如何删除它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆