David.Blackledge.com > Programming
JavaScript
One of my favorite passtimes is hacking around with JavaScript. JavaScript, for the uninformed, is not Java (it just shares some of the same syntax). It is a Client-side interpreted scripting language that is embedded in Web Pages (Java Applets are compiled programs that only have special tags embedded in Web Pages that then download the Applet). I spend a lot of time on Yahoo!'s various JavaScript-related areas: JavaScript Club (now the "javascript3" group), JavaScript Tips and Tricks Club, JavaScript Message Board, and the JavaScript Experts area where I am a bon-a-fide JavaScript Expert.
Ask me a question: I'm a Yahoo! JavaScript Expert
I also have begun contributing to the Faqts JavaScript section.
Also see the below "Published Work" section.
Everything here is copyright me (David Blackledge) and may only be used by permission unless otherwise stated in documentation or source code comments. Normally things would include permission, but I don't like to "release" stuff that's unfinished, which most of this is. In any case, just ask, I'll probably give permission.


Here is some of my work and some of my experiments:
(Each is noted with known browser compatibilities.  I don't know about versions of IE, for the most part, and I've never gotten around to downloading N6, so I can't swear to compatibility there.  A "+" means compatible with that version and all higher versions as far as I know.  A "?" means I'd guess it's compatible, but haven't done a real test.)

Games, Tools, and Utilities:

  • [N4+,  IE] Green Globs - a Math equation game from the 80's. NEW!
  • [N3+,  IE] Pop-a-mole
  • [N3+,  IE] Pop-a-mole using images (and resizable)
  • [N3+,  IE] MineSweeper
  • [N4, (IE)] IEemul - write IE-style JavaScript and have it INSTANTLY work on Netscape, too! This web site is slowly being changed to take advantage of this library.
  • [N4, IE] Edit HTML - beta of entirely JavaScript-based HTML editor.... works in Netscape and sort-of in IE (use ESC for backspace in IE4). Use NUMBERPAD for up/down/left/right in IE4 and NS4. Includes UNDO and other fun stuff.
  • [N3+, IE] XBM Drawing Library - New! all of the other XBM work I've done has culminated in the creation of a basic library for creating your own XBM images on the fly.
  • [N3+, IE] Image Creator - Actually create an XBM format image using JavaScript. Includes simple in-page save/load and can "load" an existing XBM (in text) if you just paste it into the textarea. [Replaces previous link[N3]: "Create an XBM Image through raw writing to a window (Crashes my Netscape 4.x, but should be fine on 3.0 at least)"]
  • [N3+, IE] Analog Clock new page - Actual Analog Clock, as you can see, calculates a new image every second and can be included wherever you want the image to be placed on your page. Cool, eh? Not always pretty... just 'cause I didn't spend as much time as I could on the line-drawing... but hopefully it's fast this way. Uses an XBM drawing technique like the Image Creator.
  • [N3?, IE] On the front page is my Calendar implementation... everybody does one, right? Mine is an Object. You can set an action and it will make that the HREF for every date, complete with substitution variables. It also has an Events set-up and displays days differently if there is a morning, afternoon, or an all-day event defined.  dlbCalendar.js
  • Demos and Experiments:
  • [N4, IE] Reflecting Pool - NEW! a shimmering water effect for any entered text. Very cool... I might add it to my pages someday.
  • [N4] Beginnings of a no-JavaScript-knowledge-or-coding-needed Menu creator. Just create it as a set of nested tables for hierarchy and style, include the script, and voila... menu system.
  • [(N4), IE] Recursive simplistic "Solar System Simulation" just for the fun of it. Uses IEemul (NOT quite working in Netscape as of this writing... IEemul apparently needs a little more work).
  • [N4] Layer-based web-page-browsing "Windows" - also beta... no, alpha actually... but I put it out here in case I never get around to finishing it. Little draggable Netscape-DHTML-based windows that load actual web pages (only ones from this same site, though - try just entering "Programming.html" in the text box) including ugly gadgets for resizing, scrollbars, depth (an Amiga-ism), back/forward, close, and full-screen.
    New: I found some good "competition" for this at http://www.paulgrant.on.ca/ (select "Windows" then the most equivalent choice is "HTML Windows"). He's spent a lot more time on it and has nice graphics, however he doesn't have proportional scrollbars, and apparently he never figured out how to force links to load their contents within the same "window" like I did.
  • [N4, IE] And did I mention, possibly the worlds biggest most amazingly ugly JavaScript Hack, the True JavaScript Search Engine? It's on the front page. It actually traverses every link in the first page, performing a "find()" call for your word on each page (does document.body.innerText.match(string) in IE -- only getting at most 1 match every time, for some reason). Currently only in beta stage, but the proof of concept is definitely there. Try it several times with the same phrase in Netscape, since it may think the page is loaded before the full list of links is available. Results are still a little unpredictable.
  • [N3+, IE?] Very annoying scrolling message using the "search" portion of the href (constantly reloading the page) - in a new window
  • [N3+, IE] Scroller that can have any HTML content and potentially do arbitrary movement (ok, it doesn't entirely yet)... I should really make it do that someday.
  • [N3+, IE] Fake style change "rollover" or "A:hover" effect that works on Netscape 3 (and probably earlier)
  • [N4] Fake Scrollbar setup using Layers. Allows a totally smooth "branding" technique.
  • [N4] Interactive Bouncing Balls using Layers ("hit" them to change their direction, change values for other effects)
  • [N4] Layers-based page transitions (wipes). Follow links, and the transitions stay turned on as long as they can.
  • "Published Work" NEW!
    The JavaScript Source:
  • [N3?,IE] Radio Question Validator [submitted Aug 29, 2001, listed Feb 20, 2002 (2002-20-02!)]. Original Sample One user already noted that there is one vulnerability in the script... if you name your radio buttons with numbers it won't work.
  • Not yet submitted:
  • [N4, (IE)] Netscape Hover Style. Make a:hover style work (almost) in Netscape 4 (a.hover, actually)
  • Other JavaScript Projects/ideas (mostly not started).