3 ms·
You can do some interesting things by embedding XSLT and XML into script tags, then wiring them up with MutationObservers -- I just hacked together a quick-and-
by HillRat 12y ago
You can do some interesting things by embedding XSLT and XML into script tags, then wiring them up with MutationObservers -- I just hacked together a quick-and-ugly example of a Knockout-style reactive interface, and it works just fine. The big drawbacks are that your interface is still pretty noisy (though you can preprocess some of those XML headers and CDATA section tags into the page if necessary), and using XPath or DOM functions to update the XML isn't really very fun. Still, though, it'd be interesting to see what could be done with it, even if it's probably not a front end I'd like to wrestle with for daily development.
- whichdan 12y agoThe cool thing is that jQuery/Sizzle can use normal DOM selectors on an XML document, so there is a little flexibility there, and like you said, MutationObserver is pretty excellent. Getting rid of the noise is my biggest concern. Ideally, a developer should never have to know about or touch the HTML that's being generated. It's a lofty goal, for sure.