/dollabill

Lite implementation of jQuery from scratch

Primary LanguageJavaScript

dollabill

I decided to try my hand at implementing jQuery from scratch as a way to learn vanilla JS. However, through this exercise, I gained a much greater appreciation for jQuery now that I realize how much it really does for you!

dollabill DOM manipulation (dom_manip.js)

  • addClass
  • removeClass
  • toggleClass
  • hasClass
  • is
  • html/empty
  • first
  • eq
  • find
  • filter
  • parent/children
  • closest
  • append
  • remove
  • attr
  • data
  • css

dollabill events (events.js)

  • on
  • event delegation!

Other dollabill functionality

  • extend (dollabill.js)
  • ajax (ajax.js)

TODO

  • Allow for event namespacing
  • Ideally, when appending, allow original reference to dollabill object to persist on the page somewhere
  • Events#off - best way to handle turning off delegated events?
  • Better organize event handlers
  • #is to take chain selectors (ex. #main.group)
  • #is to take :checked
  • Read bracket selectors (ex. li[data-id=1])