dom.html revision 03aed120f9b4510029d41e97188f5887ca31516d
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type="text/javascript" src="/build/yui/yui-debug.js"></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type="text/javascript" src="/build/oop/oop-debug.js"></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type="text/javascript" src="/build/event-custom/event-custom.js"></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type="text/javascript" src="/build/event/event-debug.js"></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type="text/javascript" src="/build/event-simulate/event-simulate.js"></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type="text/javascript" src="/build/dom/dom.js"></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type="text/javascript" src="/build/node/node.js"></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type="text/javascript" src="/build/dump/dump.js"></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<script type="text/javascript" src="/build/substitute/substitute.js"></script>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<input id="button1" type="button" value="Button 1" class="button" />
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<input id="button2" type="button" value="Button 2" class="button" />
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync<input id="text1" type="text" value="something" class="nothing" />
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncif (typeof loadFirebugConsole == 'function') {
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync loadFirebugConsole();
Y.on('load', function(e) {
Y.log('window load event');
Y.log('asdf');
Y.on('event:ready', function() {
Y.log('event:ready SUBSCRIBER');
Y.on('domready', function() {
Y.log('domready SUBSCRIBER');
Y.on('click', function(e, arg1, arg2) {
this.setStyle('background-color', 'red');
Y.log('document click' + this);
// Y.on('yui:log', function(msg) {
// b.appendChild(n);
Y.on('event:ready', function() {
Y.log("onDOMReady fired");
document.getElementById('form1').addEventListener('focus',
Y.log('bubble phase focus');
Y.on('focus', function() {
Y.log("FORM focus fired");
Y.on('blur', function() {
Y.log("blur fired");
// Y.on('focus', function() {
// Y.log("TEXT focus fired");
var node = Y.get('#text1');
node.on('blahblah|focus', function(e) {
//node.detach();
node.detach('blahblah|*');
document.getElementById('text1').addEventListener('focus',
Y.log('capture phase focus');
var el = Y.get('#button1');
Y.log("get got " + el);
el.setStyle('border', '3px solid red');
// h.detach();
// Y.detach('click', f, el);
// Y.Event.purgeElement(this, true, 'click');
// Y.Event.detach('click', null, this);
Y.detach('blah|*');
// var h = Y.on('blah|click', f, el);
// Y.on('blah|click',f2, el);
Y.on({
var ret = Y.on('click', function(e) {
var buts = Y.Node.all('.button');
buts.each(function(v, k) {
Y.log('blah: ' + v);
Y.each(buts, function(v, k) {
Y.log('blah2: ' + v);
Y.on('mouseover', function(e) {
// }, Y.Node.queryAll('.button'));
//}, Y.Selector.query('.button'));
Y.on('TEST:EVENT', function() {
Y.fire('TEST:EVENT', 1, 2);
Y.fire('asdf:asdf', 1);
Y.fire('asdf', 1);
var obj = new Y.Event.Target();
obj.subscribe('foo', function() {
Y.info(notdefined);
obj.subscribe('foo', function() {
Y.info(notdefined);
obj.subscribe('foo', function() {
Y.info('foo fired anyway!');
obj.fire('foo');
//if (Object.prototype.hasOwnProperty) {
//window.blah ="ad"
//alert(window.hasOwnProperty('blah'));
//alert(window.hasOwnProperty('document'));
//alert(Y.object.owns(window, 'blah'));
Y.log(handle);
var body = Y.Node.get("body");
handle = body.on("click", handleClick);
// body.detach("click", handleClick);
// handle.detach();
// Y.log(i);
Y.log("helloWorld function firing.", "info", "example");
Y.on("click", helloWorld, "#container");
// e.preventDefault();
e.halt();
Y.log("You clicked on the second YUI link.", "info", "example");
alert("You clicked on the second YUI link. Because *preventDefault* was called, this link will not navigate away from the page.");
Y.on("click", interceptLink, "#secondA");
Y.Event._attach(["click", function(e) {
console.log('native event -->');
console.log(e);
// Y.Event.onAvailable("#secondA", function() {
Y.log(arguments);
Y.log("When you begin interacting with the example at left, you'll see log messages appear here.", "info", "example");
Y.on('windowresize', function(e) {
Y.log('window resize');
// Y.on('resize', function(e) {
<a href="http://developer.yahoo.com/yui" id="firstA">The YUI Library. (Link navigates away from page.)</a>
<a href="http://developer.yahoo.com/yui" id="secondA">The YUI Library. (Link's default behavior is suppressed.)</a>