Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Unobtrusive JavaScript with jQuery. The online handout for the tutorial I gave this morning at XTech.

Tagged , , , , ,

6 comments

  1. You had me at the first slide.

    LOL!

    Mara - 6th May 2008 19:40 - #

  2. Very Helpful, thanks for sharing.

    Mark Baggott - 6th May 2008 21:38 - #

  3. Very good work, congrats!

    Ben - 6th May 2008 21:53 - #

  4. That's incredibly comprehensive, a great primer. It's interesting how the call-chaining gimmick of JQuery actually turns out to be nothing of the sort -- it's really the core idiom of what's almost a DOM-centric DSM.

    There are a still a couple of places in those slides where it does obfuscate things, though, and it would arguably be clearer to have two or three discrete statements -- mainly when the chain's context is popped with end().

    I guess it says a lot about the flexibility of JavaScript that largely the same functionality ends up being expressed so differently in JQuery, YUI, Dojo and Prototype.

    phl - 8th May 2008 11:23 - #

  5. dom-centric DSL, rather.

    oops - 8th May 2008 11:30 - #

  6. Really helpful sets of slides for non-programmers jQuery users (like me).

    I have a question regarding the label.js example:
    for example, if it is used on a contact form and the visitor hits the submit button without changing one (or all) of the input values, will them be submitted with the contained value (like "First name")? or will the be submitted as empty?

    Of course, on the server-side there could be a validator that checks the form, so it can be extented to not validate the values that are equal to the labels, right?

    Other approach could be to add some jQuery magic so when visitor clicks on the submit button, those fields that still have the "default" (=label) values, are set to empty again, so they will be submitted as empty.
    What do you think?

    Julián - 9th May 2008 20:16 - #

Sign in with OpenID

Auto-HTML: Line breaks are preserved; URLs will be converted in to links.

Manual XHTML: Enter your own, valid XHTML. Allowed tags are a, p, blockquote, ul, ol, li, dl, dt, dd, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, br, pre

A django site