hjzheng / CUF_meeting_knowledge_share

Record CUF team meeting knowledge share
121 stars 49 forks source link

2015-8-25 几个原生DOM方法 || Modular Javascript #41

Open hjzheng opened 9 years ago

hjzheng commented 9 years ago

几个原生DOM方法 || Localizing Times in JavaScript

hjzheng commented 9 years ago

Modular Javascript

Some ground rules:

  • Self-contained module
    • everything to do with my module is in my module
    • no global variables
    • if a module manages more than one thing it should be split up
  • separation of concerns
  • DRY code: Don't Repeat Yourself
  • efficient DOM usage
    • very few $(selection)
  • no memory leaks
    • all events can be unbound
  • Converting jQuery to an Object Literal Module
  • Revealing Module Pattern Javascript Tutorial
  • PubSub Javascript Design Pattern
  • PubSub Implementation