JavaScript Code Standards

Below are some general guidelines and best practices for JS, HTML, and CSS.  Many were gathered from experience and lessons learned (often the hard way).  The rest will help ensure consistency throughout your web app.


GENERAL FRONT-END

                var self = this;                
                $.ajax({
                    url: 'ajax/test.html',
                    success: function(data) {
                        $('#result').html(data);
                        self.addToLog('Load was performed.');
                    }
                });
        
 

BACKBONE.JS , REQUIRE.JS SPECIFIC

 

NODE.JS SPECIFIC