- From: Elliott Sprehn <esprehn@gmail.com>
- Date: Wed, 9 Apr 2014 17:36:06 -0700
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: Joshua Peek <josh@joshpeek.com>, www-style list <www-style@w3.org>
Received on Thursday, 10 April 2014 00:37:13 UTC
On Tue, Apr 8, 2014 at 5:51 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote: > ... > > > Although, I think I would find a more MutationObserver like API more > > useful. Since it could pick up new elements added to the tree that > > match the selector. > > > > var observer = new SelectorObserver(function(record) { > > console.log(record.target, 'now matches', record.selector); > > }); > > observer.observe(document, {selector: '.foo'}); > > I've been thinking we should add a Selector interface anyway. What > about an API like: > > var sel = new Selector(".foo", document) > sel.watch(function(record){...}) > Please don't invent new event like things. That should be sel.onchange = function(event) { } instead. - E
Received on Thursday, 10 April 2014 00:37:13 UTC