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

  • Ukraine

    Nobody reads my LiveJournal anymore, but thank you to everybody in Russia protesting Putin's insane war against Ukraine. (I know it's risky…

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.

  • 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

  • Ukraine

    Nobody reads my LiveJournal anymore, but thank you to everybody in Russia protesting Putin's insane war against Ukraine. (I know it's risky…

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.