'how to re-add "add to cart" like 'reorder' (javascipt function ajax)

This 'REORDER' button is working now,

> html

<div class="button"><a class="skinbtn point2  btn_review_write reorder-btn-nw" href="javascript:go_reOrder({.orderNo})"><em>REORDER</em></a></div>



> javasciprt

function go_reOrder(orderNo){
        $.ajax({
            method: "GET",
            cache: false,
            url: "../order/cart_ps.php",
            data: "mode=reOrder&orderNo="+orderNo,
            success: function (data) {
                if(data.error == 0){
                    //$("#devCartSno").val(data.cartSno);
                    //$("#reOrder").submit();
                    top.location.href = "/order/order.php";
                }
                return false;
            },
            error: function (data) {
                alert(data.message);
            }
        });
    }

and I make 'ADDTOCART' button like this.

<div class="button"><a class="skinbtn point2  btn_review_write reorder-btn-nw" href="javascript:go_addtocart({.orderNo})"><em>ADDTOCART</em></a></div>

What is the JavaScript corresponding to this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source