Forum Moderators: open
I have a shopping cart script which works very good.(cart.js) it is also included in some pages.
I have a script in it checking if the cart is empty or not.
-------------------------------------
function Cart_is_empty( ) {
iNumInCart = GetCookie("NumberOrdered");
if ( iNumInCart == null ) iNumInCart = 0;
if ( iNumInCart == 0 ) return true;
return false;
--------------------------------------
Below the cart I have two buttons (jpegs):
"checkout" and "continue shopping"
What I am trying to achieve is:
I have a third button "begin shopping" which I want to make it appear in the cell of the "continue shopping" button if the cart is empty. If the cart is not empty, the "continue shopping" button should appear.
So in my cart page I wrote the following code but could not make it work:
<script language="javascript" type="text/javascript">
if ( Cart_is_empty()) {
document.getElementById('cartbtn1')="<../webimages/icons/begin.gif>";
}
else {
document.getElementById('cartbtn1')="<../webimages/icons/continue.gif>";
}
</script>
It gives me the error message:
"wrong number of arguments or invalid property assignment"
Any ideas what might be missing or wrong?