Disable Statistics/Analytic Javascript

风格不统一 提交于 2019-12-10 16:25:01

问题


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.

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

AddType text/xml .php

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.

Edit: 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.


回答1:


As per @Gerben's comment...

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

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

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

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...



来源:https://stackoverflow.com/questions/9050433/disable-statistics-analytic-javascript

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