use.html revision 2077777dc207cc578a0eed314e996912addea2cb
<html>
<head>
<title>YUI 3.0</title>
<!--
<script type="text/javascript" src="http://yui.yahooapis.com/3.0.0b1/build/yui/yui-debug.js"></script>
-->
<style>
.dd {
padding-left: 20px;
padding: 5px;
margin: 2px;
cursor: move;
background-color: red;
width: 100px;
height: 100px;
zoom: 1;
}
#ddtarg {
top: 200px;
}
</style>
<body>
<input id="addButton" type="button" value="Add link" />
<div id="demo" class="dd"></div>
<div id="ddtarg" class="dd"></div>
<script type="text/javascript">
YUI({
// base: '/build/'
}).use('node', function(Y) {
var node = Y.get('#demo');
var used = [];
Y.each(Y.Env._used, function(v, k) {
used[used.length] = k;
});
used.sort();
});
YUI().use(function (Y1) {
Y1.config.doc.createElement('div'); // works
YUI(Y1.config).use(function (Y2) {
Y2.config.doc.createElement('div'); // boom. Y2.config.doc is undefined
console.log('ok');
});
// since the object reference was passed and is updated directly, this now fails as well
Y1.config.doc.createElement('div'); // boom
console.log('ok');
});
</script>
</body>
</html>