PDA

View Full Version : php counter javascript: ie v. ns


audiophan
11-29-2002, 05:02 AM
<script language="JavaScript">
var image = "pixel.gif";
var web = "FAQ";
var from = escape(document.referrer);
var page = escape(document.title);
var query = location.search;
var colorDepth = window.screen.colorDepth;
var res = window.screen.width + "," + window.screen.height;
var maxres = window.screen.availWidth + "," + window.screen.availHeight;
if (navigator.javaEnabled() == 1){ var javaa = "Enabled";} else {var javaa = "Disabled";}

document.write("<img src='../../statz/hit.php?referer=" + from + "&request=" + page + "&website=" + web + "&query=" + query + "&cDepth=" + colorDepth + "&resol=" + res + "&maxresol=" + maxres + "&java=" + javaa + "&img=" + image + "' align='middle' style='display:none'>");
</script>


concerning the above javascript. it loads the php counter when the page is viewed through internet explorer6 yet not when viewed with netscape7. any reasons/corrections?

whammy
11-29-2002, 05:18 AM
var maxres = window.screen.availWidth + "," + window.screen.availHeight;

is not cross-browser; I would have an alternative value for "maxres" depending on the browser

audiophan
11-29-2002, 03:44 PM
will that prevent the script from not sending a 'hit' to the link? or will that variable just not appear or be passed along

audiophan
12-01-2002, 05:40 PM
Originally posted by whammy
var maxres = window.screen.availWidth + "," + window.screen.availHeight;

is not cross-browser; I would have an alternative value for "maxres" depending on the browser


figured it out. when style is set to display:none netscape doesn't load the image. so i don't get a 'hit'

max res works with both browsers in an akward manner. for 1024.768 internet explorer reports it as 1024.740 while netscape says 1024.708