[thelist] disabled javascript

.jeff jeff at members.evolt.org
Fri Apr 5 14:13:00 CST 2002


> From: Joshua Olson
> > spiders also don't make image requests either so it's
> > doubtful they're actually affecting the stats for
> > thecounter.com since they do their tracking with the
> > loading of an image.  in other words, that 12% is
> > probably all browser-usage.
> How can you tell if JavaScript is enabled or disabled
> with a request to load an image?


an <img> tag makes a call to some sort of server-side script that tallies the request and sends back an image.  if it's really fancy it sends back a dynamic image with numbers that represent the current tally.

so, how's the javascript check and all the other stats figure in to this?  let's take a look at some sample code for thecounter.com's service:

<!-- Start of TheCounter.com Code -->
<script language="javascript1.2"><!--
if (v != "Netscape") {c=screen.colorDepth}
else {c=screen.pixelDepth}
function pr(n) {document.write(n,"\n");}
if (navigator.appName == "Netscape" &&
navigator.appVersion.charAt(0) == "2") {NS2Ch=1}
if (NS2Ch == 0) {
pr("<A HREF=\"http://www.TheCounter.com\" TARGET=\"_top\"><IMG")
pr("BORDER=0 SRC=\"http://c1.thecounter.com/id=90725"+r+"\"></A>")}
<noscript><a href="http://www.TheCounter.com" target="_top"><img
src="http://c1.thecounter.com/id=90725" border=0></a>
<!-- End of TheCounter.com Code -->

what's happening is the javascript code is doing some basic checks for things like resolution, colordepth, whether or not java is available, etc.  then, it writes out an image tag, appending its findings as a query string.  as for browsers without javascript, there's a <noscript> block with the same <img> tag, sans the query string variables.  obviously the inclusion of these query string variables is an indication of javascript being present.


jeff at members.evolt.org

More information about the thelist mailing list