My favorite privacy settings I'm looking for general feedback on this module.  Here is what it handles on the page:



This is a private "class" meaning none of its properties are available outside of it.

init is run at run-time.  pre sets up parameters to be sent to the server via ajax and post receives the ajax response.

I can post the code for Class.create if needed, but I wanted to focus on the class itself.

$A.Class.create('private', {
    Name: 'Settings',
    E: {
        save_button:  '#save_button',
        cancel_button:  '#cancel_button',
        se_form: '#se_form'
    },
    init: function () {
        var self = this;
        $(this.E.save_button).on("click", function () {
            $A.Packet.push({model: self.Name});
        });
        $(this.E.cancel_button).on("click", function () {
            Page.flip('fave');
        });
    },
    pre: function (packet) {
        packet.h_token = Storage.getRemembered();
        packet.privacy = this.getSaved();
        packet.state = true;
        return packet;
    },
    post: function (packet) {
        Page.flip('fave_custom');
        return packet;
    },
    getSaved: function () {
        var form_elements = this.E.se_form.elements,
            send_value = '',
            iterator;
        for (iterator = 0; iterator &lt; form_elements.length; iterator++) {
            if (form_elements[iterator].checked) {
                send_value = form_elements[iterator].value;
            }
        }
        return send_value;
    }
});
The main improvement with this code would be your handling of jQuery elements.  You should save them in the object literal like you did with plain elements.

Secondly, you can shorten up your code, using jQuery to pull the radio button value.

Your code might be a bit faster, as it works at a lower abstraction level, but if you do choose to use it, it might be better to abstract it out into a DOM function.

Below is the modified code.

$A.Class.create('private', {
    Name: 'Settings',
    J: {
        save_button:          $('#save_button'),
        cancel_button:        $('#cancel_button')
    },
    init: function () {
        var self = this;
        this.J.save_button.on("click", function () {
            $A.Packet.push({model: self.Name});
        });
        this.J.cancel_button.on("click", function () {
            Page.flip('fave');
        });
    },
    pre: function (packet) {
        packet.h_token = Storage.getRemembered();
        packet.privacy = this.getSaved();
        packet.state = true;
        return packet;
    },
    post: function (packet) {
        Page.flip('fave_custom');
        return packet;
    },
    getSaved: function () {
        return $('input[name=privacy]:checked', '#se_form').val(); 
    }
});

/* Put in a DOM abstraction library

            var form_elements = this.E.se_form.elements,
                send_value = '',
                iterator;
            for (iterator = 0; iterator &lt; form_elements.length; iterator++) {
                if (form_elements[iterator].checked) {
                    send_value = form_elements[iterator].value;
                }
            }
            return send_value;
        }
*/