Wednesday, March 21st, 2007

Dean Edwards puts out Base2, a standards based JavaScript library

Category: 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
    including document.createEvent(), dispatchEvent(), addEventListener(), etc
  • Supports DOMContentLoaded
  • Fixes getAttribute()/setAttribute() (Internet Explorer)
  • Implements getElementsByClassName()
  • Implements a few other useful DOM methods like getComputedStyle() and compareDocumentPosition()
  • 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?

Posted by Dion Almaer at 3:37 pm
45 Comments

++++-
4 rating from 48 votes

45 Comments »

Comments feed TrackBack URI

I say “wow”. I can’t wait to dig in.

Comment by jdalton — March 21, 2007

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.

Comment by Jeffrey — March 21, 2007

@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…

Comment by Dean Edwards — March 21, 2007

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?

Comment by Nir Tayeb — March 21, 2007

@Nir – I didn’t override getElementById because I decided to use the Selectors API for all element retrieval.

Comment by Dean Edwards — March 21, 2007

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.

Comment by cdude — March 21, 2007

You should complain to your local NSA sniffing station about the slow-down, no problem from mainland Europe.

Comment by Martin — March 21, 2007

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 ;)

Comment by spark — March 22, 2007

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

Comment by Justin Lumb — March 22, 2007

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.

Comment by Justin — March 22, 2007

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.

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 :)

Comment by Andrea Giammarchi — March 22, 2007

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. :-)

Comment by Dean Edwards — March 22, 2007

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 ;)

Comment by Nicolas — March 22, 2007

Nice job.

Comment by Dan — March 22, 2007

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

Comment by digitarald — March 22, 2007

Excellent blog

Comment by Norman — June 12, 2007

You should complain to your local NSA sniffing station about the slow-down, no problem from mainland Europe.

Comment by ingilizce tercume — July 21, 2007

I can’t even load the front page. I’m in the west coast of the US

Comment by emlak — August 2, 2007

Hello. It is interest article! Add it for digg for ather people. I think it will interest for they.

Comment by SiteD — August 16, 2007

ajax is future

Comment by Back to school — August 30, 2007

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

Comment by jan — September 1, 2007

Nice job..)

Comment by tercüme — September 14, 2007

keep up the your great work.
thank you.

Comment by Dj Tiesto — September 17, 2007

For the most part the users using older than IE6 are so small and generally would not be using the applications I write anyway.

Comment by NBA — September 17, 2007

Very helpful library. why doesn’t you override the getElementById method to bind every element we want to use with your library.

Comment by Alonzo Mourning — September 17, 2007

hey, thx for the great stuff. keep up your nice work! needed this script!

Comment by Inko — September 23, 2007

Excellent blog

Comment by çeviri — October 8, 2007

Nice article and very fantastic site.

Comment by Katalog stron — October 19, 2007

Has anybody translate this article to german?

Comment by Stanley — October 19, 2007

Great work Dean. Is there an updated version of this?

Comment by Meteko — October 21, 2007

nice and best article.

Comment by electronic projects — October 24, 2007

Great work Dean. I can’t see an updated version of this!

Comment by youtube — October 31, 2007

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

Comment by Webtechnik — November 12, 2007

keep up the your great work.
thank you.

Comment by www.r10.net küresel ısınmaya hayır seo yarışması — November 13, 2007

nice article.

Comment by Tercume — November 21, 2007

Thanks for the information.

Comment by Webtechnik — December 11, 2007

The information is very interesting. Thx for the great work.

Comment by arbeitsschutz — December 11, 2007

Thanks for the information.

Comment by Goldfield — April 15, 2008

thanks for the good information, its very intresting. thanks

Comment by heilkreidefan — April 22, 2008

its intresting for better web
thx

Comment by muskelaufbau — April 22, 2008

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

Comment by plywoodindonesia — May 22, 2008

We decided it was because I run on Windows. :-)

Comment by bankalar — June 30, 2008

great post cool info

Comment by Disneyd — July 21, 2008

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

Comment by SchnellerMuskelaufbau — June 2, 2010

Does it support older Internet Explorer versions like 5 or 5.5 for example ?

Comment by RobertLAS — September 29, 2010

Leave a comment

You must be logged in to post a comment.