Professional CodeIgniter, Thomas Myer
Chapter 5: Building a Shopping Cart
122
echo "
<
/tr
>
\n";
}else{
//just in case!
echo "
<
tr
>
<
td
>
No items to show here!
<
/td
>
<
/tr
>
\n";
}//end outer if count
?
>
<
/table
>
<
/form
>
<
div id='ajax_msg'
>
<
/div
>
<
/div
>
If you were to update your browser now, you ' d see something very similar to Figure 5 - 6 .
Figure 5-6
Adding a JavaScript Handler
In the shoppingcart view, you added a call to a JavaScript function called
jsRemoveProduct()
, passing
in a product ID. It ' s now time to create this function, adding it to the customtools.js you created
previously in the chapter.
previously in the chapter.
c05.indd 122
c05.indd 122
6/10/08 5:35:20 PM
6/10/08 5:35:20 PM