Tuesday, October 14th, 2008

Bacon – a sizzling new YUI utility

Beware of what you ask for. After Stephen Woods asked on Twitter why there are just no Bacon utilities in the browser Dav Glass of the YUI team went right to it and created YUI Bacon.

YUI bacon is now the only JS solution to fry any HTML element with a few lines of code:


  1. var foo = new YAHOO.util.Bacon('demo');
  2. var bar = new YAHOO.util.Bacon('demo2');

As always with Dav, the utility comes with a full API and documentation, features useful methods like fryBacon() and stopFryBacon() and there are several clever custom events (baconReady, baconDone, baconStart) to subscribe to.

If you dive deeper into the workings of bacon you also find hidden messages of what the future might hold: void cook() An override method for extending this class to maybe fry eggs too.

I am now waiting for jQuery cocktail sausage and protoype T-Bone.

Posted by Chris Heilmann at 6:36 am

2.8 rating from 41 votes


Comments feed TrackBack URI

where no this planet is it already friday? …wanna be there… ;-)

Comment by muhqu — October 14, 2008

This will go great with breakfast.nom().nom().nom().nom() extension I’ve been toying with. Thanks!

Comment by igaenssley — October 14, 2008

Apparently Bacon is the universal common-ground for JavaScript libraries:

Comment by JohnResig — October 14, 2008

wow, John, a cloud of bacon. This is taking the web to the next dimension.

Comment by Chris Heilmann — October 14, 2008

I’m just glad I’m finally having some influence on the future of web development.

Comment by ysaw — October 14, 2008

MooTools only works with beef products.

Comment by MattCoz — October 14, 2008

I think we can interpret this as a direct challenge to the jQuery team. 1.3 better have $(‘div’).bacon({
brand: “farmer john”,
flavor: “maple”,
pieces: 2

Comment by Jigs — October 14, 2008

Leave a comment

You must be logged in to post a comment.