Javascript Object Tree Favelet Looking for the drawings? They're over here, and my drawing blog is this way. Memory leak patterns in JavaScript JavaScript is a powerful scripting language used to add dynamic content to Web pages. It is especially beneficial for everyday tasks such as password validation and creating dynamic menu components. While JavaScript is easy to learn and write, it is prone to memory leaks in certain browsers. Note that the article assumes you are familiar with using JavaScript and DOM elements to develop Web applications. Memory leaks in JavaScript JavaScript is a garbage collected language, meaning that memory is allocated to objects upon their creation and reclaimed by the browser when there are no more references to them. Internet Explorer and Mozilla Firefox are two browsers that use reference counting to handle memory for DOM objects. What's wrong with circular references? A circular reference is formed when two objects reference each other, giving each object a reference count of 1. Listing 1. Another memory leak pattern Listing 2. Back to top Closures in JavaScript Listing 3. Learning about closures
Understanding MVC And MVP (For JavaScript And Backbone Developers) Last updated: 16th Jan, 2012. Before exploring any JavaScript frameworks that assist in structuring applications, it can be useful to gain a basic understanding of architectural design patterns. Design patterns are proven solutions to common development problems and can suggest structural paradigms to help guide us in adding some organization to our application. I think patterns are exciting as they're effectively a grass roots effort that build upon the collective experience of skilled developers who have previously faced similar problems as we do now. Although developers 10 or 20 years ago may not have been using the same programming languages for implementing patterns, there are many lessons we can learn from their efforts. In this section, we're going to review two popular patterns – MVC and MVP. MVC (Model-View-Controller) is an architectural design pattern that encourages improved application organization through a separation of concerns. Smalltalk-80 MVC Models Views Templating Summary