Tuesday, October 14th, 2008p>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:
- var foo = new YAHOO.util.Bacon('demo');
- var bar = new YAHOO.util.Bacon('demo2');
As always with Dav, the utility comes with a full API and documentation, features useful methods like
stopFryBacon() and there are several clever custom events (
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