onClick+Firefox

Discussion in 'JavaScript' started by DJuse, May 5, 2008.

  1. #1
    I have this piece of code; what it does is that when user press a button, the item is added to the shopping cart. I use the onClick even't for this, its working perfectly on IE, however no on Firefox or related browsers.
    Does anyone have any idea what this may be?
    I looked around the net for this problem, and found a lot of people with the same problem, but no a definitive solution.
    Thanks for the help!
    	<?
    	if ($productrow['status']) {
    		if ($productrow['type'] == 0 && ($isMember || $isAdmin)) {
    			echo "<a href='#' onclick='append_cookie(\"cartcontent\", \"".$productrow['productID']."\", \"\")'>";
    			echo "<img src='$addtocart_button' border=0>";
    			echo "</a>";
    			echo "<a href='".FILE_DOWNLOAD."?productID=".$productrow['productID']."'>";
    			echo "<img src='$download_button' border=0>";
    			echo "</a>";
    		} else if ($productrow['type'] == 0 && (!$isMember && !$isAdmin)) {
    			echo "<b>Member Download Only</b>";
    		} else if ($productrow['type'] == 1 || $productrow['type'] == 2) {
    			echo "<a href='#' onclick='append_cookie(\"cartcontent\", \"".$productrow['productID']."\", \"\")'>";
    			echo "<img src='$addtocart_button' border=0>";
    			echo "</a>";
    			echo "<a href='#' onclick='append_cookie(\"cartcontent\", \"".$productrow['productID']."\", \"\");self.location.replace(\"".FILE_INDEX."?action=checkout\")'>";
    			echo "<img src='$buy_button' border=0>";
    			echo "</a>";
    		}
    	} else { // product n/a for download or purchase
    		echo "<img src='$na_button' border=0>";
    	}
    	?>
    PHP:

     
    DJuse, May 5, 2008 IP
  2. apmsolutions

    apmsolutions Peon

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you have firebug installed? It integrates with Firefox and will give you specific javascript errors. It may help you locate your issue.
     
    apmsolutions, May 5, 2008 IP
  3. DJuse

    DJuse Active Member

    Messages:
    509
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks for your reply apmsolutions, Im checking around and I see it have to do with the onClick thing. A lot of people have the same issue...I will test it with firebug and see what happen!
     
    DJuse, May 5, 2008 IP