jayvi
12-06-2009, 12:31 PM
This is driving me crazy!
So I'm using a javascript file to switch out items when a thumbnail is clicked. This includes photo, title, description, price, size, quantity and add to cart button....
The original code on the html file works fine, but as soon as it is swapped by onclick, the 'add to cart' button does nothing!
Here is the code:
var addDisplay = document.getElementById('cart-add');
addDisplay.innerHTML = "<a class='item_add' href='/' onclick='simpleCart.add(); return false;'><img src='images/shop/cart-add.jpg' width='118' height='26' border='0'></a>";
that is what shows in my javascript file...
here is what's on the html file:
<div id="cart-add"><a class='item_add' href='/' onclick='simpleCart.add(); return false;'><img src="images/shop/cart-add.jpg" width="118" height="26" border="0"></a>
</div>
and that adds the item to the cart just fine, but when a thumbnail is clicked on, activating the javascript file to switch out the item/elements, the 'add to cart' button no longer does anything... by the way, I am using simpleCart.js (http://simplecartjs.com/)
PLEASE HELP, PLEASE!?
Please PM me if you need more info... or post here if you have a solution. Thanks!
So I'm using a javascript file to switch out items when a thumbnail is clicked. This includes photo, title, description, price, size, quantity and add to cart button....
The original code on the html file works fine, but as soon as it is swapped by onclick, the 'add to cart' button does nothing!
Here is the code:
var addDisplay = document.getElementById('cart-add');
addDisplay.innerHTML = "<a class='item_add' href='/' onclick='simpleCart.add(); return false;'><img src='images/shop/cart-add.jpg' width='118' height='26' border='0'></a>";
that is what shows in my javascript file...
here is what's on the html file:
<div id="cart-add"><a class='item_add' href='/' onclick='simpleCart.add(); return false;'><img src="images/shop/cart-add.jpg" width="118" height="26" border="0"></a>
</div>
and that adds the item to the cart just fine, but when a thumbnail is clicked on, activating the javascript file to switch out the item/elements, the 'add to cart' button no longer does anything... by the way, I am using simpleCart.js (http://simplecartjs.com/)
PLEASE HELP, PLEASE!?
Please PM me if you need more info... or post here if you have a solution. Thanks!