解决方法
对于dojo 1.7,基于JQuery答案,我会这样做:
require(["dojo/on","dojo/_base/array"],function(on,array){ on(dojo.doc,"DOMNodeInserted",function(evt){ var classes = dojo.attr(evt.target,"class").split(" "); if (array.indexOf(classes,"myclass") > -1) { console.debug("Inserted node with class myclass",evt.target); } }); });