Quantcast
Channel: JavaScript – Xomino
Viewing all articles
Browse latest Browse all 34

TypeAhead.js – making it readable and “why dojo?” I get it!

$
0
0

LOVE THIS

I wanted to break into the TypeAhead.js library which XPages uses to make the type ahead functionality work

looks like this….uuuuurgh

TypeAhead.js minified

TypeAhead.js minified

Quick search online and I found http://jsbeautifier.org/ and when I took the code and pasted it in look what happened – LOVE IT

readable TypeAhead.js

readable TypeAhead.js

And as soon as I look through this I get why IBM went with dojo. It is not about the pretty interface (which jQuery wins hands down) it is about the programming framework.

The provide, declare, hitch capabilities within dojo allow for class object creation with locally scoped variables and many other cool things. jQuery does not provide a framework for this, it doesn’t try to either. You can always create class objects manually and that is what people write around their jQuery. Dojo provides the class framework directly and the TypeAhead.js is a fantastic piece of work. One of these days when I have nothing better to do I will break down how it works.



Viewing all articles
Browse latest Browse all 34

Trending Articles