Archive for September, 2008

Blogging live from jQuery Camp 2008 (@MIT in Boston)

Posted on September 28th, 2008 in JavaScript, jQuery | No Comments »

So far it’s been great! Good food, good talks. Here’s the full topic list. (scroll down to the middle of the page)

Took some vids until my camera died, more to come, once I convert ‘em and upload ‘em. Here’s the most interesting things I learned so far:


  • jQuery does do DOM caching! It listens for DOM-modified events to clear it’s internal cache.
  • That random jquery[random numbers] variable that gets added to the window object is to uniquely identify the jQ instantiation (so you can do things like run multiple instances of jQuery on the same page).
  • I knew about .end() but .andSelf()? Cool!
  • Nokia and Microsoft join the jQuery camp. Nokia will have jQuery built into their phones (they have some browser-like app environment) $M will have it in their VS/ASP.NET and all future versions of Visual Studio will come with it going foward. link link.
  • jQuery is planning to be the first library that doesn’t use any browser sniffing. They are going to use a “quirk check” method of creating some elements that aren’t added to the page that check for things like if white space gets removed when created an element that starts with a space (IE bug) and others. This way they don’t have to be constantly updating for new browsers.
  • John’s working on a cool new DOM selector API called Sizzle that’s supposed to be a lot faster. It works by search for the last element in your query up. For example $('div p'); would look for all p elements on the page that has a parent div element.
  • You can use create a namespace when binding events. For example $('#foo').bind('', func); so it’s easy to unbind later, and you can encapsulate your events for your own plugins to prevent conflicts. You can also create your own custom events like $('#foo').bind('apple', func); and trigger them using $('#foo').trigger('apple'); .
  • $('#element').data(); lets you bind data to DOM elements (see Data Cache under Internals section here.) Since you can’t really bind an object to a DOM node jQuery assigns it a random key behind the scenes which it references. This is really handly for storing all kinds of data.

jQuery UI:
- Uses the data method above A LOT.
- Lots of enhancements, most interestingly, with drag-and-drop which detects floated elements and allows you to have draggable lists within draggable lists.
- jQuery UI team also working on some experimental stuff for Webkit only (iPhone / Safari / Chrome).
- Theming jQuery UI with ThemeRoller

- I’ve been using this really old but handy site as a jQ reference: made by Yehuda Katz (also a speaker). Asking around on the conference IRC chan I found there’s a much newer / improved one at by Remy Sharp. They’re going to try to update the prior site with the latter.
- Canvas tag is pretty basic but sweet. John Resig gave a whole presentation on it since the using jQuery with Firefox plugins couldn’t make it.

Making a synchronous DWR call

Posted on September 18th, 2008 in DWR, JavaScript | 11 Comments »

It took me about half an hour of Googling to find this, and I couldn’t readily find this in the DWR documentation. Hopefully this may save someone some time:

To make a DWR call synchronous (meaning browser-blocking) you must pass an object as one of the arguments of your DWR call with a property async set to false.

I needed this feature in project where a collection object sends out a call for more data if it didn’t have it:

_getData: function(offset, limit){
    var r;
    DWRcomponent.getComments(offset, limit,{ 
        async: false,
        callback: function(s){
            r = toJSON('(' + s + ')');
    return r;