开发者

Are there any good examples on how to organize JavaScript code?

I've learned JavaScript and know how to write OO JavaScript, and I can accomplish those assignment like aut开发者_StackOverflowocomplete, 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).


http://www.klauskomenda.com/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.com/2007/08/22/again-with-the-module-pattern-reveal-something-to-the-world/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜