问题描述
我想使用jQuery删除这个Google Analytics区块。
< script type =text / javascript> ;
var gaJsHost =((https:== document.location.protocol)?https:// ssl。:http:// www。);
document.write(unescape(%3Cscript src ='+ gaJsHost +google-analytics.com/ga.js'type ='text / javascript'%3E%3C / script%3E));
< / script>
< script type =text / javascript>
尝试{
// var pageTracker = _gat._getTracker(xxx);
pageTracker._trackPageview();
} catch(err){}
< / script>
因为我正在根据客户端规范为jQuery创建一个定制的屏幕阅读器转换器。这是Google Analytics(分析)对我的看法。
b 它与 试试这个: 希望有帮助! I want to remove this Google Analytics block, using jQuery. THE REASON Because I am creating a bespoke screen reader convertor for jQuery based on a client specification. It's the Google Analytics that is bugging me. THE PROBLEM It works with Try this: Hope that helps! 这篇关于删除< script>使用jQuery的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
$ b .remove()
一起使用,直到您离开,然后按回。 Google Analytics(分析)挂起。
var replacementDoneIn = $(document.body).text(); // remove Google Analytics document.write line
var regExMatch = /document\.write\(unescape/g;
var replaceWith =//document.write;
var resultSet = replacementDoneIn.replace(regExMatch,replaceWith);
$(body)。html(resultSet);
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
//var pageTracker = _gat._getTracker("xxx");
pageTracker._trackPageview();
} catch(err) {}
</script>
.remove()
until you navigate away, then press back. Google Analytics hangs.var replacementDoneIn = $(document.body).text(); //remove Google Analytics document.write line
var regExMatch = /document\.write\(unescape/g;
var replaceWith = "//document.write";
var resultSet = replacementDoneIn.replace(regExMatch, replaceWith);
$("body").html(resultSet);