Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

InputComplete: my very first JS "library"

I wrote my very first JavaScript "library". Whereby library I mean:

-- doesn't trample the "window" object's namespac
-- doesn't trample your existing event handlers, and adding your own doesn't break things
-- easily reusable by others for other purposes

Here's the InputComplete (and InputCompleteData) class file, object oriented and MVC:

http://danga.com/demo/tagcomplete/inputcomplete.js

View the source for how to use it:

http://danga.com/demo/tagcomplete/

Create a data model (the word list to autocomplete), and create autocomplete objects for each input element, using that model.

Enjoy!
Tags: javascript, tech, work
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 17 comments