Showing attachment for Ticket #2529331
Append node list
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script src="http://yui.yahooapis.com/3.2.0/build/yui/yui.js" type="text/javascript" charset="utf-8"></script>
<style>
div {
border:1px solid black;
width:200px;
height:200px;
}
</style>
</head>
<body>
<div id="bar">
Foo, Bar should end up here.
</div>
<div id="foo">
<p>Foo</p>
<p>Bar</p>
</div>
<script type="text/javascript" charset="utf-8">
YUI({filter:"raw", combine:false}).use('node', function(Y) {
var ps = Y.all("p");
var bar = Y.one("#bar");
// Fails, because Y.all(ps) inside Node.insert returns an empty NodeList
bar.append(ps);
});
</script>
</body>
</html>
Uploaded By: Satyen Desai
Date: 09/17/10
Size: 1001 bytes
Name: appendNodeList.html
Click here to download the file.
Date: 09/17/10
Size: 1001 bytes
Name: appendNodeList.html
Click here to download the file.