Wednesday, March 21st, 2007
Dean Edwards puts out Base2, a standards based JavaScript library
Dean Edwards has come out with what he calls Yet Another JavaScript Library Without Documentation.
But, this is from Dean, not your cousin Bubba, so what is interesting about it?
Highlights
- A fast implementation the Selectors API
- Fixes broken browser implementations of the DOM events module
includingdocument.createEvent()
,dispatchEvent()
,addEventListener()
, etc- Supports DOMContentLoaded
- Fixes
getAttribute()/setAttribute()
(Internet Explorer)- Implements
getElementsByClassName()
- Implements a few other useful DOM methods like
getComputedStyle()
andcompareDocumentPosition()
- Supports a variety of browsers including ancient browsers like IE5.0 (Windows and Mac)
There aren’t fancy effects, but that isn’t the mission. “It only does standards. But it is my belief that if you build on standards in the right way, you can help future-proof your scripted pages.”
Dean is looking to see if there is any interest in this. What do you say?





I say “wow”. I can’t wait to dig in.
Valario is hinting at big speed-ups for selectors in Mootools 1.1. I’d love to put Moo’ in the benchmark app at the site above but don’t have the time (anyone else…?). Does anyone have any comparison comments? I have to wonder if Mootools 1.1 *uses* Base2 and that is the source of the performance increase.
@Jeffrey – Motools uses a variation of Base.js to provide inheritance but that’s the only overlap.
@Dion – Hey! My cousin Bubba was a big help on this project. Now I have to buy him some ice cream to cheer him up…
Very helpful library. why doesn’t you override the getElementById method to bind every element we want to use with your library.
I look into your selectors-api implemention. It’s very complicate to understand the code, but I succeed somehow.
I will love to see integration of this library into MooTools.
How did you improve the addEventListener? what is different?
@Nir – I didn’t override getElementById because I decided to use the Selectors API for all element retrieval.
is it just me or is his site always incredibly slow. I can’t even load the front page. I’m in the west coast of the US.
You should complain to your local NSA sniffing station about the slow-down, no problem from mainland Europe.
Don’t forget it’s his server on his KITCHEN :)
http://dean.edwards.name/
http://www.flickr.com/photos/mollyeh11/65792910/in/set-1419295/
He was probably downloading some torrents or something ;)
Yeah, I’m in the UK and Dean’s site doesn’t load for me every time. But it is very cool that he runs it off his own computer.
As a side note, I know it is often said we should support IE 5 win/mac as being the responsible way. But since these are not supported with security updates, isn’t it more resposible for web developers to boycot these browsers and not support them, given the security risks, and rise and rise of online fraud
I have decided (whether best practice or not) to only support IE6/7,Firefox1/2,Opera8/9, and if I had a mac I’d support Safari too.
For the most part the users using older than IE6 are so small and generally would not be using the applications I write anyway.
Justin Lumb, I think the only thing developers should boycot is the usage of IE browser, every version.
Since we can’t change this situation and people uses IE 5 and 5.5 is quite a bad practice (at least in my opinion) to support only IE6 or greater because if your library doesn’t work, people simply look for another site, imho :)
I didn’t set out to support IE5 Mac/Win and I recognise that they are minority browsers. However, because I am supporting only basic DOM functionality there is no good reason to leave them out. Mac IE5 already has quite good standards support for DOM events already.
Oh, and my site is quite slow sometimes. Sorry about that. I was up until late last night with Stuart Langridge on IM trying to work out why my sever sucks so bad. We decided it was because I run on Windows. :-)
I’ve a project that need script for IE 5.0 and IE 5.5. Maybe your library will do the job :) Thanx Dean ! I’ll be your beta tester for old browsers ;)
Nice job.
Great work, this will be the library of choice when i have to script cross browser. Its not really “base”ic any more, but its still basic enough to build more on it, good splitting. Why did u not use cssQuery as selector api, only for the element extending?
… the moo-Guy
Excellent blog
You should complain to your local NSA sniffing station about the slow-down, no problem from mainland Europe.
I can’t even load the front page. I’m in the west coast of the US
Hello. It is interest article! Add it for digg for ather people. I think it will interest for they.
ajax is future
Does it support older IE versions like 5 or 5.5? I believe there are still some users out there using these outdated versions.
-Jan
Nice job..)
keep up the your great work.
thank you.
For the most part the users using older than IE6 are so small and generally would not be using the applications I write anyway.
Very helpful library. why doesn’t you override the getElementById method to bind every element we want to use with your library.
hey, thx for the great stuff. keep up your nice work! needed this script!
Excellent blog
Nice article and very fantastic site.
Has anybody translate this article to german?
Great work Dean. Is there an updated version of this?
nice and best article.
Great work Dean. I can’t see an updated version of this!
Good idea – a Java library. Very good thing! We program Java, PHP, Flash and so on. Good to have a source. Regards, http://www.webtechnik.net
keep up the your great work.
thank you.
nice article.
Thanks for the information.
The information is very interesting. Thx for the great work.
Thanks for the information.
thanks for the good information, its very intresting. thanks
its intresting for better web
thx
Good idea – a Java library. Very good thing! We program Java, PHP, Flash and so on. Good to have a source. Regards, http://www.plywoodindonesia.com
We decided it was because I run on Windows. :-)
great post cool info
I think people should just stop using ancient browsers and the Internet Explorer in general. Would mean a lot of less work for us programmers :P
Does it support older Internet Explorer versions like 5 or 5.5 for example ?