According to the docs here I should be able to use
Y.one("#container").appended( newImages, function(){
console.log("appended");
});
to add new items to my page, but I get an error saying #container has no method 'appended'.
If I try Y.one("#container").masonry('appended', newImages); it tells me that #container has no method ‘masonry’
I do define masonry at the beginning of my function var masonry = new Y.Masonry({ ... so I’m confused on what I’m missing
You’re confusing a bit the jQuery style with the YUI style. In jQuery calling the
$function returns ajQueryobject which has a lot of functions. But in YUI not all components are methods that can be called from a node query. In this case, Masonry is defined as a class from which all instances get certain methods likeappended()orreload(). This means that your code should look like this: