eorroe / nodelist.js Goto Github PK
View Code? Open in Web Editor NEWNodeList.js - Use the Native DOM APIs as easily as jQuery
License: MIT License
NodeList.js - Use the Native DOM APIs as easily as jQuery
License: MIT License
Hi, I'm no longer working on this library, but I wouldn't mind doing so if I knew what people were actually using this for. I'm clueless about what's this library is being used for.
Please share your thoughts on my library and what you're using it for, production? Just playing around with the library? Anything?
using classList and its methods add / remove is not working when selecting with nodeList
document.getElementById('id').classList.add('bounceOutLeft', 'hidden')
works but using nodeList:
$$('#id').classList.add('bounceOutLeft', 'hidden');
throws the error: Uncaught TypeError: $$(...).classList.add is not a function(…)
Just stumbled on this library and it's amazing, even more so it's gzipped size! my workflow complety revolves around npm and I think I'd be great if NodeList gets published as an npm package.
Have you seen the recently specced Elements collection? https://twitter.com/openwebdaily/status/593439888080502787
It adds the Array methods and is intended as a replacement for NodeList. Maybe it would make sense to refactor your code so that it becomes “Elements on steroids”, with an Elements polyfill as a basis.
I have trouble getting this code working in firefox. In chrome it works like a charm.
I'm fairly new to Jquery and have no idea how to solve the problem.
$$(".edit").addEventListener("input", function() {
var content = this.innerHTML;
$$(".edit").set('textContent', content)
});
Here is a jsfiddle which works in chrome but not in firefox: http://jsfiddle.net/7mf8zfmb/
kind regards
Hi,
found your nodelist.js and really like it.
Looked into the code and would happy to understand how you created that kind of chaining?
$$('.child').id; // ['', '' ... x10]
$$('.child')
is a list of nodes (nodelist object) and the chained call .id
not exists in your code. So chained calls (properties / methods?) to nodelist mapped to each item of nodelist?
May you explain how that is done? 🥇
One thing I have really found useful in jQuery is the parent selector – it lets me target only nodes that have a certain child node. jQuery has multiple ways of doing this, but the one I use, and the one that would probably be easiest to implement, is .has()
. (see https://api.jquery.com/has/ )
Is there any possibility something like that could be added?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.