Ben Vinegar - 5 Tips For Better Javascript Applications - Presentation Transcript
5 Tips for Better
Javascript Applications
Ben Vinegar, FreshBooks
Forewarning
• Most examples in jQuery
• But applicable to every other framework
• 5 Tips ... 5 Minutes
• Brief topic introductions
• Apologies for speaking fast
• Wish me luck!
Base Class
var Dialog = Class.extend({
constructor: function() {
// common setup
},
open: function() { /* open dialog */ },
close: function() { /* close dialog */ }
});
Concrete Class
var EditTaxesDialog = Dialog.extend({
constructor: function() {
this.super();
// setup specific to Edit Taxes
},
});
var editTaxesInstance = new FancyWidget();
Libraries
• Standalone solutions
• inheritence.js, John Resig
• base.js, Dean Edwards
• Framework solutions
• prototype.js
3. debugger keyword
4. Custom Events
Like click, change, focus, blur ...
but you name them
0 comments
Post a comment