28
Nov

Last time I was able to listen to Steve's talk in #wordcamp SF, and learnt a lot


Finally, I got chance to read his book, and below are things I learnt this time.

  • All rely on Ajax not good; not to send all data to client using Ajax (need django template list)
  • Split one javascript into two, one required before onLoad, the other delay loading and processing
  • old Google Analytics uses document.write Script Tag to asynchronically load javascript, which was blocking the subsequence DOM loading; now, it uses Script DOM Element
  • fast inline script execute by setTimeout(init, 0), slow inline script execute by onLoad
  • inline script should before CSS, or after all other resources
  • any global javascript variable used more than twice should define a local variable; any javascript object property used more than twice should define a local variable
  • in javascript for loop, -- is faster than ++
  • simultaneously request more than 2 resources from the same domain will introduce request competetion
  • css selector: ID > class > type > adjacent > child > descendant > universal

KEEP LEARNING EVERYDAY

Leave a Reply