473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Whats wrong with this code?

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
Expand|Select|Wrap|Line Numbers
  1. <a id="143066" name="143066" href="page.php" onclick="return trackclick(this.href, this.name, '143066 anchor text:page1');">Page 1</a>
tracker.js thats included in the head. using:
<script type="text/javascript" src="js/tracker.js">
</script>
Expand|Select|Wrap|Line Numbers
  1. function trackclick(url, aid, atxt) {
  2.     if(document.images){ 
  3.           var img = new Image();
  4.           var ClickTrack = "tracker.php";
  5.           var image_src = ClickTrack+"?url="+url+"&aid="+aid+"&atxt="+atxt+"&loc="+document.location;
  6.             img.src = image_src;
  7.         }
  8.     return true;
  9. }


I know the PHP works. It works fine with IE. but here it is:
Expand|Select|Wrap|Line Numbers
  1. include($_SERVER['DOCUMENT_ROOT']."includes/global.php");
  2.  
  3. $ip                = getenv("REMOTE_ADDR");
  4. $userAgent        = getenv("HTTP_USER_AGENT");
  5. $clicktime        = date("Y-m-d G:i:s T");
  6. $url            = $url;
  7. $url_id         = $aid;
  8. $anchor_text    = $atxt;
  9. $loc            = $loc;
  10.  
  11. $data = array('ip' => $ip, 'useragent' => $userAgent, 'clicktime' => $clicktime, 'url' => $url, 'url_id' => $url_id, 'anchor_text' => $anchor_text, 'loc' => $loc);
  12.             $db->loadModule('Extended');
  13.             $db->extended->autoExecute('logger', $data, MDB2_AUTOQUERY_INSERT);
  14.  
  15.  
I know this is a FF compatibility issue, just can't figure it out.
Dec 19 '07 #1
4 1086
drhowarddrfine
7,435 Expert 4TB
Possibly not the problem but id names may not begin with a number.
Dec 20 '07 #2
Changed the anchor tag, now begins with a letter. Still doesn't work in FF.

[HTML]<a id="nev003" name="nev003" href="page.php" onclick="return trackclick(this.href, this.name, 'nev003 anchor text:nev003');">Page 1</a>[/HTML]

Any other ideas?
Dec 20 '07 #3
Anybody else have any ideas?
Dec 20 '07 #4
acoder
16,027 Expert Mod 8TB
document.location should be document.URL or window.location.
Dec 22 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Colin Steadman | last post by:
I have created a function to kill all session variables that aren't in a safe list. This is the function - Sub PurgeSessionVariables For Each Item In Session.Contents Select Case Trim(Item)...
3
by: Chris Geerdink | last post by:
combo with PHP. what is wrong with the Javascript? else { include("mysql.php"); $query1 = mysql_query("INSERT INTO gbook (naam, email, text) VALUES ('".$_POST."', '".$_POST."',...
4
by: asdf | last post by:
Hello! Can someone tell me whats wrong with this piece of code: Option Compare Database Option Explicit Sub retrieve() Dim rst As ADODB.Recordset Dim i As Integer
1
by: aa | last post by:
When I am reading from local disk (d:), everithing is OK, but then I am reading from map disk I am geting the this error. Whats wrong. Thanks Server Error in '/Extra' Application....
3
by: mahsa | last post by:
Hi do you know whats wrong with this code? <asp:HyperLink id="HLink_Help" runat="server" NavigateUrl='<%# "javascript:window.open('comments.aspx?id=1,width=500,height=600, scrollBars=yes');"...
4
by: blah | last post by:
Hello everyone, Ive been trying to get my application to "click" on a button in another application using SendMessage, Ive gotten this far but Im not sure whats wrong with this code, here is the...
7
by: Mike Barnard | last post by:
It's a simple test... VERY SIMPLE. But... In an external stlyesheet some attributes don't show. With the same styles cut and pasted to the test internally it works as expected. Anyone tell...
1
by: Abubakar | last post by:
Hi, In my application, Some of my thread gets stuck somewhere. The vs2k5 debugging "Thread" window shows that stuck thread and I can I dentify it. In its Name column the following text is...
5
by: islayer | last post by:
can someone tell me what is wrong with the bold code? i am just learning perl. the program should create a perl file with a random name (5 letters, followed by a number), but the name is always just...
5
by: hiqu | last post by:
This issue is driving me nuts and not able to figure out whats wrong. I've this code in my firefox extension. Firefox always hangs and reports the script is busy. if I introduce a break...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.