8 September 2006
Javascript inheritance for AJAX
Posted by Mikhail Esteves under: AJAX; Tips .
Every programmer who’s tried to apply classical Object Oriented techniques when developing with JavaScript, has at one time or another asked themselves the question: How do you call or invoke a super class method? Before the Ajax craze got into full swing, this question rarely arose because most developers were only exposed to the language when doing client-side form validation or simple DHTML / DOM element visibility toggling. In those simple situations, functional programming is sufficient and OO is of lesser importance. Now that Ajax is all the rage, programmers have been building increasingly complex systems involving large amounts of client-side JavaScript. As a result, many have tried to apply OO techniques to JavaScript as a way to manage that complexity. In the process, most developers quickly realize that JavaScript is a prototypical language and as a result lacks many of the more familiar OO conventions.