禁用统计数据/分析的Javascript [英] Disable Statistics/Analytic Javascript

查看:135
本文介绍了禁用统计数据/分析的Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的免费虚拟主机提供商追加分析JavaScript来所有的PHP和HTML文件。这是很好的,但我使用的NuSOAP创造一个web服务我正在一个WSDL文件。我的织补主机其加入到我的PHP生成WSDL文件。

My free webhost appends analytics javascript to all PHP and HTML files. Which is fine, except that I'm using nuSoap to create a WSDL file for a webservice I'm working on. My darn host adds this to my php-generated WSDL file.

有些人认为它添加到.htaccess文件:

Some people have suggested add this to the .htaccess file:

AddType text/xml .php

这是花花公子,但它会禁用PHP引擎为好,而且也没有办法生成WSDL即可。

Which is dandy, but it disables the PHP engine as well, and there's no way to generate the WSDL then.

我到处找,没有运气。主机商并没有电子邮件或支持票响应无论是。

I've searched everywhere, no luck. Webhost does not respond to emails or support tickets either.

编辑:我的虚拟主机使用的脚本Histats。出版Histats.com。此外,这个JavaScript块超出了< HTML>< / HTML> 标签并不会通过验证

The script my webhost uses is Histats. Published by Histats.com. Also, this JavaScript block falls outside the <html></html> tags and won't pass validator.

推荐答案

根据@戈的评论...

As per @Gerben's comment...

添加&LT;! - 不起作用。主机已经开始评论他们的额外的东西,而 - &GT; 下面被覆盖

Adding <!-- does not work. The host already starts their extra stuff with a comment, and the --> that follows gets overridden.

添加标题(内容类型:文本/ XML'); 不执行任何操作时,JavaScript仍然显示

Adding header('Content-Type: text/xml'); does nothing, the javascript still shows.

不过!我们已经找到了答案......把退出();!在PHP脚本结束后将禁用此功能

HOWEVER! We've found the answer... putting exit(); at the end of the PHP script will disable this function!

作为一个侧面说明,以@Gerben先生 - 谢谢你,我已经投了你的其他的答案之一,所以你获得信贷这个...

As a side note to Mr. @Gerben -- Thank you, and I've voted up one of your other answers, so you get credit for this...

这篇关于禁用统计数据/分析的Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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