[thelist] disabled javascript

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


joshua,

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

simple.

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><!--
s="na";c="na";j="na";f=""+escape(document.referrer)
//--></script>
<script language="javascript1.2"><!--
s=screen.width;v=navigator.appName
if (v != "Netscape") {c=screen.colorDepth}
else {c=screen.pixelDepth}
j=navigator.javaEnabled()
//--></script>
<script><!--
function pr(n) {document.write(n,"\n");}
NS2Ch=0
if (navigator.appName == "Netscape" &&
navigator.appVersion.charAt(0) == "2") {NS2Ch=1}
if (NS2Ch == 0) {
r="&size="+s+"&colors="+c+"&referer="+f+"&java="+j+""
pr("<A HREF=\"http://www.TheCounter.com\" TARGET=\"_top\"><IMG")
pr("BORDER=0 SRC=\"http://c1.thecounter.com/id=90725"+r+"\"></A>")}
//--></script>
<noscript><a href="http://www.TheCounter.com" target="_top"><img
src="http://c1.thecounter.com/id=90725" border=0></a>
</noscript>
<!-- 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

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list