- Not every plugin should be done in jQuery
- Standard Javascript is suitable for many cross-browser plugins
- Show code to create a single interface to
console
across all browsers
- Show code to create a single interface to
- Advantages of using jQuery is cross-browser consistency
- DOM manipulation
- Ajax
- Events
- Standard interface for plugin development
return this
should always be the last statement- Manipulate DOM post plugin initialization
- Ensure all options have defaults
- Demo power of extend
- Don't force user to pass in options
- Demo power of isFunction
- Pass additional information to a callback
- Runs continuously
- Maintains low memory footprint
- Load other plugin dependent on this plugin
- Since every plugin should return self, we need another way to get info
- Fire a custom event
- Especially useful for plugins which load themselves via a remote location and write themselves into the DOM (i.e. Facebook)