4 ms·
Most of my JavaScript these days is little interactive things embedded in web pages, and I use raw JavaScript. All the stuff I used jQuery for back in the 1990'
by madhadron 7y ago
Most of my JavaScript these days is little interactive things embedded in web pages, and I use raw JavaScript. All the stuff I used jQuery for back in the 1990's is in the language and DOM API now.
They generally have the form:
document.addEventListener('DOMContentLoaded', function() {
var m = {
...model fields...
_observers: new Set(),
notify: function() {
this._observers.forEach(function(observer) {
observer();
}
}
};
var elem1 = document.getElementById('...');
elem1.addEventListener('...', function() {
...update fields on m...
m.notify();
});
m._observers.add(function() {
...update elem1 from m...
});
m.notify();
});
- adventured 7y ago> All the stuff I used jQuery for back in the 1990's is in the language and DOM API now. Huh? Wrong decade I think. jQuery wasn't released until 2006.
- madhadron 7y ago...am I going crazy? There was a library with the $ that we used in the late '90's to handle cross browser issues. I thought it was an early version of jQuery. What was it called?
- MildlySerious 7y agoMooTools and Dojo come to mind, but I'm thinking of the 2000s also.
- benbristow 7y agoPrototype maybe?
- thrownaway954 7y agoNope, you're not... everyone seems to forget the decade of 2000-2010 when calculating any dates nowadays. It's like that old saying... Remember kids, 1990 was 28 years ago, not 18.
- madhadron 7y agoI was signposting it in my head by "I used this at my job before college" which puts it squarely in the late '90's. Which is why I'm totally confused.
- thrownaway954 7y agoBTW... jQuery was inspired by CSSQuery https://en.wikipedia.org/wiki/CssQuery https://en.wikipedia.org/wiki/CssQuery
- eu 7y agoPrototypeJS