Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created June 24, 2010 17:01
Show Gist options
  • Save lsmith/451674 to your computer and use it in GitHub Desktop.
Save lsmith/451674 to your computer and use it in GitHub Desktop.
// Primary YUI instance for the page
YUI().use('node', function (Y) {
Y.Global.on('fooFrame:message', function (e) {
console.log(e.message);
});
});
// Create another instance for the iframe
YUI({
doc: document.getElementById('foo-frame').documentElement
}).use('node', function (Y) {
// Alias the iframe's global YAHOO for convenience
var YAHOO = Y.config.win.YAHOO;
// Subscribe to events from the objects in the iframe's YAHOO
YAHOO.propertyNS.myDataTable.on("initEvent", function () {
// and broadcast the events to the Global YUI event target
Y.Global.fire("fooFrame:message", { message: "DataTable initialized" });
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment