• I learned it for the web, mostly when mucking around with forms.

    I had an idea back in 1999 that I could make a search engine that didn't require a search engine. It was for football videos, and the form had a load of SELECT lists that I wanted to filter each other, such that you searched by choosing things: "This team, in that season, against this other team, at that venue, show me the goals and fouls.".

    I kinda knew it was possible, but at the time that meant writing my own cross-browser library to figure out the differences between Netscape Navigator and Internet Explorer.

    Then I went mad on this new-found knowledge and decided that what the world really needed were IFRAMEs. Except they didn't really exist at the time, and so I used a frameset to hide a 1 pixel high frame in the bottom of the window.

    Then I made the JavaScript in the main window detect changes in a SELECT list, and load a pre-defined JavaScript file in the hidden frame. Once that frame loaded it would reference a function in the main frame as a kind of callback mechanism, and populate the next SELECT list.

    I sat down and did the math, and if I just splatted 310,000 JavaScript files onto the file system to cope with every permutation of SELECT list, then I would've created a search engine that used filtered lists to search and was driven totally by static files.

    It took a few days to write, and more than a little smashing of my head against the wall as I quickly discovered the quirks between Netscape and Internet Explorer, but to my total shock it worked.

    Not only did it work, but it worked well. When the site was eventually launched across 300 football club sites, this one part of the site was heavily promoted and had hundreds of thousands of concurrent users in the first weekend. Because it was all just static files, nothing broke at all.

    I liked JavaScript after that, probably went a bit overboard with it for a while, now I use it sparingly but quite enjoy it when I do use it.

About

Avatar for Velocio @Velocio started