Javascript/jQuery redirect to page
<p>I am using simplecart js. It's a really simple shop with one product. I would like to automatically redirect to the cart page when someone clicks the add to cart button. </p>

<p>The code for adding a product:</p>

<pre><code>&lt;div class="simpleCart_shelfItem"&gt;
&lt;h2 class="item_name"&gt; Awesome T-shirt &lt;/h2&gt;
&lt;p&gt;  &lt;input type="text" value="1" class="item_Quantity"&gt;&lt;br&gt;
&lt;span class="item_price"&gt;$35.99&lt;/span&gt;&lt;br&gt;
&lt;a class="item_add" href="javascript:;"&gt; Add to Cart &lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<p>The listener in simpleCart.js:</p>

<pre><code>/* here is our shelfItem add to cart button listener */
                , { selector: 'shelfItem .item_add'
                    , event: 'click'
                    , callback: function () {
                        var $button = simpleCart.$(this),
                            fields = {};

                        $button.closest("." + namespace + "_shelfItem").descendants().each(function (x,item) {
                            var $item = simpleCart.$(item);

                            // check to see if the class matches the item_[fieldname] pattern
                            if ($item.attr("class") &amp;&amp;
                                $item.attr("class").match(/item_.+/) &amp;&amp;
                                !$item.attr('class').match(/item_add/)) {

                                // find the class name
                                simpleCart.each($item.attr('class').split(' '), function (klass) {
                                    var attr,
                                        val,
                                        type;

                                    // get the value or text depending on the tagName
                                    if (klass.match(/item_.+/)) {
                                        attr = klass.split("_")[1];
                                        val = "";
                                        switch($item.tag().toLowerCase()) {
                                            case "input":
                                            case "textarea":
                                            case "select":
                                                type = $item.attr("type");
                                                if (!type || ((type.toLowerCase() === "checkbox" || type.toLowerCase() === "radio") &amp;&amp; $item.attr("checked")) || type.toLowerCase() === "text") {
                                                    val = $item.val();
                                                }               
                                                break;
                                            case "img":
                                                val = $item.attr('src');
                                                break;
                                            default:
                                                val = $item.text();
                                                break;
                                        }

                                        if (val !== null &amp;&amp; val !== "") {
                                            fields[attr.toLowerCase()] = fields[attr.toLowerCase()] ? fields[attr.toLowerCase()] + ", " +  val : val;
                                        }
                                    }
                                });
                            }
                        });

                        // add the item
                        simpleCart.add(fields);
                    }
                }
            ]);
        });
</code></pre>

<p>From what I have read it is bad practice to use href="javascript:;" is it a good idea to change it to a click function that will add the item to the cart then go to the cart page or just add the redirect? How do I go about this? Thanks</p>
