Created
June 24, 2010 17:01
-
-
Save lsmith/451674 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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