将这个广告标签和 ID 添加到 URL

编程入门 行业动态 更新时间:2024-10-17 04:59:27
本文介绍了将这个广告标签和 ID 添加到 URL - 如何删除它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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

In our CMS the developer added an "addthis" script which appends a hashtag and a tracking id to the browser address bar URL, for example http://www.site/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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-17 19:57:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/921513.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:标签   广告   URL   ID

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!