javascript

E4X and Prototype Goodness

I got around to trying the E4X-based query structure this morning, and it works like a charm.  It's now possible to write your queries like this:
Query.execute(
  <query>
    update contact set
      name = :name,
      email = :email
    where id = :id
  </query>,
  {
    id: new QueryParam(id, "integer"),
    name: new QueryParam(name),
    email: new QueryParam(email)
  }
);
There's [...]

More Thoughts on Server-Side JS

I got a lot of great comments (along with some not-so-great ones) regarding my server-side JS implementation. As expected, quite a few people were very excited about using AS3 on the server instead of JS, and I agree. It got me thinking about how much code reuse you could get within an application. [...]

Why JavaScript (or really, ECMAScript)?

After my last post on CF and JS integration (via Rhino), I got several comments that can be summarized as "why?". I addressed the issue in a rather oblique manner in my last post; here's a more full treatment.
Before I start, I want to make incredibly clear that I'm not talking about a new [...]

The Rhino Is Coming … to fix CFML

Show of hands, how many people like CFML? Ok, how many like the ColdFusion Platform? What's the difference, you ask? CFML is a markup language that you do most CF Platform development in. You can use CFSCRIPT (which is ECMAScript-like) for certain things, but CFML is the Platform workhorse. The [...]

More on Prototype Templates

So it turns out I'm a a bit silly (duh).  My previous post on Templates was all well and good, but it didn't consider IE6.  IE6 loudly complains if you have substitution strings in 'id' attributes, so if you need to do that (usually the case), you have to use the TEXTAREA hack I listed.  [...]

Inline Prototype Templates

If you've ever used Prototype's Templates, you'll know how powerful they are. If you haven't tried them, you should. One thing that makes them even more powerful is creating them from in-your-page HTML, rather than as JS Strings. This lets your designer build templates in raw HTML, and then you can transparently [...]

JavaScript. At Last.

Working on gpsracr.com this evening, and whipped open my favorite chunk of JS: Prototype. It just gets better all the time. They've added support for automatically executing text that is returned from an Ajax.Request with an appropriate MIME type (like text/javascript), which means you don't even need result handlers. Just dispatch to [...]

Improved ComboBox Demo

After Koen (a coworker) pointed out that my online ComboBox demo was rather user-unfriendly (like how you just had to "know" to type an 'a' in the fields), I threw some instructions around it. It's available at /web/widgets/, as before. There's also a new distro at /web/widgets/widgets-b2231.zip, and the project page has been [...]

ComboBox Widget Update

I've been making tweaks to my ComboBox widget (first published in July 2005) in various apps of mine that use it, and figured it was time to publish an update. You can download the archive at /web/widgets/widgets-b2218.zip, play with the online demo (which is just the expanded archive) at /web/widgets/, or visit the project [...]

Scriptaculous Droppables Tweak

Scriptaculous has some fairly slick drag and drop facilities built in, though they're clearly targeted at backing some of the other features (like Sortables). I was playing today and noticed the lack of an onUnhover callback corresponding to the onHover method of a Draggable (i.e. a drop-zone). That's not needed for Sortables, but [...]