5 ms·
Probably this JavaScript function I posted on my blog in 2003 https://simonwillison.net/2003/Mar/25/getElementsBySelector/ https://simonwillison.net/2003/Mar/25
by simonw 4y ago
Probably this JavaScript function I posted on my blog in 2003 https://simonwillison.net/2003/Mar/25/getElementsBySelector/ https://simonwillison.net/2003/Mar/25/getElementsBySelector/
- cookie_monsta 4y agoWow. You were the original querySelector. It's funny how you forget that somebody actually sat down and wrote these things into existence at some point. Thanks!
- hn_throwaway_99 4y agoEven more impressive to me is writing things into existence without the benefit of being able to dig in to the underlying browser tech, and only being able to use the public (at the time) DOM APIs like getElementById, etc.
- kmoser 4y agoWow, 10 years before document.querySelectorAll()!
- dmitriid 4y ago> Wow, 10 years before document.querySelectorAll() querySelectorAll wouldn't ever appear without jQuery which got its idea from Simon's idea. And even then querySelectorAll was so poorly implemented that it didn't even have any useful helper methods.
- iamwil 4y agoHe's understating, perhaps on purpose. Datasette, Django, and Lanyrd.
- hnfong 4y agoTo be fair the original question was "most" impactful thing...
- karaterobot 4y agoIOU 1 beer.
- s1291 4y agoTen years ago I was reading [0] and I remember your name was mentioned somewhere. Here is a quote: > Locating elements by their class name is a widespread technique popularized by Simon Willison (http://simon.incutio.com http://simon.incutio.com) in 2003 and originally written by Andrew Hayward (http://www.mooncalf.me.uk http://www.mooncalf.me.uk) [0] Page 91 from "Pro JavaScript Techniques" by John Resig.
- simonw 4y agoYeah here's Andy's getElementsByClassName post (via the Internet Archive): https://web.archive.org/web/20030402172546/http://blog.mooncalf.me.uk/archive/2003/03/25 https://web.archive.org/web/20030402172546/http://blog.moonc...
- jmt_ 4y agoHey Simon, thanks for creating Django with Adrian. I was deeply interested in programming from a young age but learning Django in my teens sparked a passion for web development that has yet to feign so many years later! Appreciate all your contributions to this space.
- Beta-7 4y agoWhat a coincidence. Just yesterday i've used getElementsBySelector for the first time while making a greasemonkey script.
- Aeolun 4y agoI like seeing this. At the time I remember thinking we needed something like this, and why doesn’t the browser have it already? Then thinking, I suppose you could do it by (exactly the method you used), but never actually doing it because if it were that simple, someone would have already done it. Actually, seeing the date, I realize this predates me even leaving high-school, which makes it even more atrocious that I never knew of it!
- swyx 4y ago/* That revolting regular expression explained /^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/ \---/ \---/\-------------/ \-------/ | | | | | | | The value | | ~,|,^,$,* or = | Attribute Tag */ all regexes should have ascii art explainers! (from https://static.simonwillison.net/static/2003/getElementsBySelector.js https://static.simonwillison.net/static/2003/getElementsBySe...)