Got some code that works in IE, when I run in FF nothing happens. If I debug the code in venkman or firebug it magically works. But if I just run it in Firefox nothing happens?
any Ideas?
HTML Anchor tag
[CODE=html]<a id="143066" name="143066" href="page.php" onclick="return trackclick(this .href, this.name, '143066 anchor text:page1');"> Page 1</a>[/CODE]
tracker.js thats included in the head. using:
<script type="text/javascript" src="js/tracker.js">
</script>
[CODE=javascript]function trackclick(url, aid, atxt) {
if(document.ima ges){
var img = new Image();
var ClickTrack = "tracker.ph p";
var image_src = ClickTrack+"?ur l="+url+"&aid=" +aid+"&atxt="+a txt+"&loc="+doc ument.location;
img.src = image_src;
}
return true;
}[/CODE]
I know the PHP works. It works fine with IE. but here it is:
[CODE=php]include($_SERVE R['DOCUMENT_ROOT']."includes/global.php");
$ip = getenv("REMOTE_ ADDR");
$userAgent = getenv("HTTP_US ER_AGENT");
$clicktime = date("Y-m-d G:i:s T");
$url = $url;
$url_id = $aid;
$anchor_text = $atxt;
$loc = $loc;
$data = array('ip' => $ip, 'useragent' => $userAgent, 'clicktime' => $clicktime, 'url' => $url, 'url_id' => $url_id, 'anchor_text' => $anchor_text, 'loc' => $loc);
$db->loadModule('Ex tended');
$db->extended->autoExecute('l ogger', $data, MDB2_AUTOQUERY_ INSERT);
[/CODE]
I know this is a FF compatibility issue, just can't figure it out.
any Ideas?
HTML Anchor tag
[CODE=html]<a id="143066" name="143066" href="page.php" onclick="return trackclick(this .href, this.name, '143066 anchor text:page1');"> Page 1</a>[/CODE]
tracker.js thats included in the head. using:
<script type="text/javascript" src="js/tracker.js">
</script>
[CODE=javascript]function trackclick(url, aid, atxt) {
if(document.ima ges){
var img = new Image();
var ClickTrack = "tracker.ph p";
var image_src = ClickTrack+"?ur l="+url+"&aid=" +aid+"&atxt="+a txt+"&loc="+doc ument.location;
img.src = image_src;
}
return true;
}[/CODE]
I know the PHP works. It works fine with IE. but here it is:
[CODE=php]include($_SERVE R['DOCUMENT_ROOT']."includes/global.php");
$ip = getenv("REMOTE_ ADDR");
$userAgent = getenv("HTTP_US ER_AGENT");
$clicktime = date("Y-m-d G:i:s T");
$url = $url;
$url_id = $aid;
$anchor_text = $atxt;
$loc = $loc;
$data = array('ip' => $ip, 'useragent' => $userAgent, 'clicktime' => $clicktime, 'url' => $url, 'url_id' => $url_id, 'anchor_text' => $anchor_text, 'loc' => $loc);
$db->loadModule('Ex tended');
$db->extended->autoExecute('l ogger', $data, MDB2_AUTOQUERY_ INSERT);
[/CODE]
I know this is a FF compatibility issue, just can't figure it out.
Comment