How to know what percentage of visitors to a website don't use javascript?
Is there an easy way to开发者_开发问答 find out what percentage of visitors to a webpage are not using javascript?
If you want to do it yourself try this:
<noscript><img src="countNoJS.php" style="display:none" /></noscript>
<script>document.write('<img src="countJS.php" style="display:none" />');</script>
Most of the more modern analytic programs will do this for you but ... you can use the tag and a 1x1 gif and count the hits in the log files.
<noscript>
<img src="http://www.mysite.com/assets/images/no_javascript_1x1.gif" alt="" width="1" height="1" border="0" />
</noscript>
or for secure pages:
<noscript>
<img src="https://www.mysite.com/assets/images/no_javascript_1x1.gif" alt="no javascript marker" width="1" height="1" border="0" />
</noscript
If this was a high use image you could have an issue with proxy caching but suspect there are so few people with no javascript , this will not be an issue.
Mike
精彩评论