Jump to content


Photo

Javascript help for firefox


  • Please log in to reply
2 replies to this topic

#1 xam

xam
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 26 March 2006 - 04:33 PM

Hello everyone,

I need help to fix my firefox problem with my below code..

This is my tracklink.html file
<script type="text/javascript">
function logClick() {
    window.focus();
    bug = new Image();  
    bug.src = 'http://mywebsite.com/track.php?pg=' + escape(document.title);
}
</script>
<iframe src='showads.html' frameborder='0' width='300' height='50' onFocus='logClick()'></iframe>

This is my track.php file
<?
mysql_connect("localhost", "root", "mypass") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("stats") or die(mysql_error());
echo "Connected to Database<br />";
$ip = $_SERVER['REMOTE_ADDR'];
$page = $_GET['pg'];
mysql_query("INSERT INTO stats (page, ip) VALUES ('$page', '$ip')") or die(mysql_error());
mysql_close();
?>

When someone click a link on the tracklink.html page, it should send pagename and visitorip to track.php and track.php should send this results to my database..

Everything is work with Internet Explorer, But mozilla cant sent results to track.php..

I tested it with direct link with mozilla e.g.:
http://mywebsite.com/track.php?pg=test
It work.. Its %100 javascript error.... I need more stable javascript code to track clicked links..

My regards.


#2 xam

xam
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 26 March 2006 - 11:54 PM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]We have 30,227 registered members
[/quote]

Where ?

#3 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 28 March 2006 - 09:10 PM

[!--quoteo(post=358706:date=Mar 27 2006, 12:54 AM:name=xam)--][div class=\'quotetop\']QUOTE(xam @ Mar 27 2006, 12:54 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Where ?
[/quote]

??

anyway, open your Javascript Console in FF (tools menu). you may need to clear it as some ads on some sites fill it full of rubbish...try out your site....what errors/warnings come up in the JS Console?
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users