HiEverybody
07-12-2004, 07:40 PM
My friend gets the error message "object expected" when he clicks on the add to shopping cart link.
What is he doing wrong
Please Help???
Here is the code for the order page:
Code:
<html>
<head>
<title>Easy Credit Online Shopping</title>
<SCRIPT LANGUAGE = Javascript>
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<p><font size="5"><b>Welcome to the Easy Credit Online Shopping Site</b></font>
</p>
<p> </p>
</div>
<hr>
<p align="center">Press 'V' to view your Shopping cart or click <a href="cart.htm">here</a></p>
<table width="70%" border="1" align = "center">
<tr>
<td width="24%" height="37">T-Shirt</td>
<td width="66%" height="37" align="left" valign="middle">
<p align="left">Lime Green T-Shirt with Orange Easy Credit Logo - Small</p>
<p ><a href="javascriptlace('T-Shirt - Small')" align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%" height="37">R29.50</td>
</tr>
<tr>
<td width="24%" height="37">T-Shirt</td>
<td width="66%" height="37" align="left" valign="middle">
<p align="left">Lime Green T-Shirt with Orange Easy Credit Logo -Medium</p>
<p ><a href="javascriptlace('T-Shirt - Medium')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%" height="37">R34.50</td>
</tr>
<tr>
<td width="24%" height="37">T-Shirt</td>
<td width="66%" align="left" valign="middle">
<p align="left">Lime Green T-Shirt with Orange Easy Credit Logo - Large</p>
<p ><a href="javascriptlace('T-Shirt - Large')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R39.50</td>
</tr>
<tr>
<td width="24%" height="37">Capp</td>
<td width="66%" align="left" valign="middle">
<p align="left">Adjustable Lime Green Cap with Orange Easy Credit Logo</p>
<p ><a href="javascriptlace('Lime Green Cap')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R18.75</td>
</tr>
<tr>
<td width="24%" height="37">Capp</td>
<td width="66%" align="left" valign="middle">
<p align="left">Adjustable Orange Cap with Lime Green Cap Easy Credit Logo</p>
<p ><a href="javascriptlace('Orange Cap')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R18.75</td>
</tr>
<tr>
<td width="24%" height="37">Easy Credit Teddy Bear</td>
<td width="66%" align="left" valign="middle">
<p align="left">25cm Tall Lime Green Teddy Bear with Orange T-shirt</p>
<p ><a href="javascriptlace('Teddy Bear')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R66.50</td>
</tr>
</table>
<p align="center">E-mail us for more information: <a href="mailto:easycredit@hotmail.com">easycredit@hotmail.com</a></p>
</body>
</html>
Here is the code for the viewing of the shopping cart page:
Code:
<html>
<head>
<title>Easy Credit Online Shopping</title>
<SCRIPT LANGUAGE = Javascript>
var items_string = "";
function place(new_item)
{
items_string = items_string + "xxx" + new_item;
document.cookie = "items=" + escape(items_string);
}
"items=xxxT-Shirt - Small;xxxT-Shirt - Medium;xxxT-Shirt - Large;xxxLime Green Cap;xxxOrange Cap;xxxTeddy Bear;"
whole_items_cookie = "items=xxxT-Shirt - SmallxxxT-Shirt - MediumxxxT-Shirt - LargexxxLime Green CapxxxOrange CapxxxTeddy Bear";
if (whole_items_cookie !="")
{
items_array = whole_items_cookie.split("xxx");
items_array[0] = "items=";
items_array[1] = "T-Shirt - Small";
items_array[2] = "T-Shirt - Medium";
items_array[3] = "T-Shirt - Large";
items_array[4] = "Lime Green Cap";
items_array[5] = "Orange Cap";
items_array[6] = "Teddy Bear";
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<SCRIPT LANGUAGE = Javascript>
if(items_array != "")
{
for (i=1; i < items_array.length; i++)
{
document.write("<h3>" + items_array[i] + "</h3>");
}
}
</script>
</body>
</html>
What is he doing wrong
Please Help???
Here is the code for the order page:
Code:
<html>
<head>
<title>Easy Credit Online Shopping</title>
<SCRIPT LANGUAGE = Javascript>
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center">
<p><font size="5"><b>Welcome to the Easy Credit Online Shopping Site</b></font>
</p>
<p> </p>
</div>
<hr>
<p align="center">Press 'V' to view your Shopping cart or click <a href="cart.htm">here</a></p>
<table width="70%" border="1" align = "center">
<tr>
<td width="24%" height="37">T-Shirt</td>
<td width="66%" height="37" align="left" valign="middle">
<p align="left">Lime Green T-Shirt with Orange Easy Credit Logo - Small</p>
<p ><a href="javascriptlace('T-Shirt - Small')" align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%" height="37">R29.50</td>
</tr>
<tr>
<td width="24%" height="37">T-Shirt</td>
<td width="66%" height="37" align="left" valign="middle">
<p align="left">Lime Green T-Shirt with Orange Easy Credit Logo -Medium</p>
<p ><a href="javascriptlace('T-Shirt - Medium')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%" height="37">R34.50</td>
</tr>
<tr>
<td width="24%" height="37">T-Shirt</td>
<td width="66%" align="left" valign="middle">
<p align="left">Lime Green T-Shirt with Orange Easy Credit Logo - Large</p>
<p ><a href="javascriptlace('T-Shirt - Large')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R39.50</td>
</tr>
<tr>
<td width="24%" height="37">Capp</td>
<td width="66%" align="left" valign="middle">
<p align="left">Adjustable Lime Green Cap with Orange Easy Credit Logo</p>
<p ><a href="javascriptlace('Lime Green Cap')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R18.75</td>
</tr>
<tr>
<td width="24%" height="37">Capp</td>
<td width="66%" align="left" valign="middle">
<p align="left">Adjustable Orange Cap with Lime Green Cap Easy Credit Logo</p>
<p ><a href="javascriptlace('Orange Cap')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R18.75</td>
</tr>
<tr>
<td width="24%" height="37">Easy Credit Teddy Bear</td>
<td width="66%" align="left" valign="middle">
<p align="left">25cm Tall Lime Green Teddy Bear with Orange T-shirt</p>
<p ><a href="javascriptlace('Teddy Bear')"align="left">Add to Shopping Cart</a></p>
</td>
<td width="10%">R66.50</td>
</tr>
</table>
<p align="center">E-mail us for more information: <a href="mailto:easycredit@hotmail.com">easycredit@hotmail.com</a></p>
</body>
</html>
Here is the code for the viewing of the shopping cart page:
Code:
<html>
<head>
<title>Easy Credit Online Shopping</title>
<SCRIPT LANGUAGE = Javascript>
var items_string = "";
function place(new_item)
{
items_string = items_string + "xxx" + new_item;
document.cookie = "items=" + escape(items_string);
}
"items=xxxT-Shirt - Small;xxxT-Shirt - Medium;xxxT-Shirt - Large;xxxLime Green Cap;xxxOrange Cap;xxxTeddy Bear;"
whole_items_cookie = "items=xxxT-Shirt - SmallxxxT-Shirt - MediumxxxT-Shirt - LargexxxLime Green CapxxxOrange CapxxxTeddy Bear";
if (whole_items_cookie !="")
{
items_array = whole_items_cookie.split("xxx");
items_array[0] = "items=";
items_array[1] = "T-Shirt - Small";
items_array[2] = "T-Shirt - Medium";
items_array[3] = "T-Shirt - Large";
items_array[4] = "Lime Green Cap";
items_array[5] = "Orange Cap";
items_array[6] = "Teddy Bear";
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<SCRIPT LANGUAGE = Javascript>
if(items_array != "")
{
for (i=1; i < items_array.length; i++)
{
document.write("<h3>" + items_array[i] + "</h3>");
}
}
</script>
</body>
</html>