Skip to content

Instantly share code, notes, and snippets.

@jakearchibald
Created November 10, 2009 16:00
Show Gist options
  • Save jakearchibald/230981 to your computer and use it in GitHub Desktop.
Save jakearchibald/230981 to your computer and use it in GitHub Desktop.
(function() {
var glow = new Glow('2').load().loaded(loaded);
function loaded() {
var thingToClick = glow.dom.create('<a href="#">Thing to click</a>');
glow.events.addListener(thingToClick, 'click', function() {
glow.load('widgets').loaded(widgetsLoaded);
});
}
function widgetsLoaded() {
// do stuff with widgets
}
})();
// the above should also work with 'ready' instead of 'loaded',
// the only difference is 'ready' also waits for the dom to be ready
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment