I've learned JavaScript and know how to write OO JavaScript, and I can acplish those assignment like autoplete, photo gallery with JavaScript, but I just don't know how to organize the codes. For example, when and where to define a function, how to organize those variables, etc.
So I'm looking for some good and simple examples of JavaScript project to learn the good practices. Can you suggest any? (such as a list data filter).
I've learned JavaScript and know how to write OO JavaScript, and I can acplish those assignment like autoplete, photo gallery with JavaScript, but I just don't know how to organize the codes. For example, when and where to define a function, how to organize those variables, etc.
So I'm looking for some good and simple examples of JavaScript project to learn the good practices. Can you suggest any? (such as a list data filter).
1 Answer
Reset to default 16http://www.klauskomenda./code/javascript-programming-patterns/
That link discusses many different javascript organization patterns, including the one I prefer, the Revealing Module Pattern.
More information about the Revealing Module Pattern is here:
http://www.wait-till-i./2007/08/22/again-with-the-module-pattern-reveal-something-to-the-world/