[uf-discuss] Tutorial on AHAH (such a cool technology!)

Paul Wilkins pmw57 at xtra.co.nz
Mon Mar 5 14:07:22 PST 2007


From: "Paul Wilkins" <pmw57 at xtra.co.nz>
> It might start to look something like this

Note to self, don't post when rushed for time.

// beware, untested code, dragons may be lurking
ahah = {
  init : function() {
    var els = document.getElementsByTagName('a');
    Array.forEach(els, function(el) {
      var href = el.getAttribute('href');
      var id = 'ahah-' + el.getAttribute('id');
      addEvent(el, 'click', 'function(){ahah.get("'+href+'", "'+id+'")');
    });
  },
  get : function(url, target, delay) {
   // code as per normal
  }
};

> How close would something like this get to cleaning things up?

-- 
Paul Wilkins



More information about the microformats-discuss mailing list