Hoping someone can help me, in my class I have the following code.  I
been looking around and can't figure out how to rewrite the
bindWithEvent.

================================
    XHRify: function () {
        var a = $$(".addtocart_form");
        if (!a.length) return MyCart;
        a.each(function (b) {
            b.addEvent("submit", MyCart.add.bindWithEvent(b, true))
        })
    },
    add: function (a) {
        (new Event(a)).stop();
        var b = this.getProperty("title");
        this.set("send", {
            url: this.getProperty("action"),
            data: $(this),
            onComplete: function (f) {
                MyCart.update(f)
            },
            onRequest: function () {
               MyCart.roarit.alert("<h3>Added to your cart:</h3><p>" +
b + "</p>")
            }
        }).send()
    },

================================

Reply via email to