Build your Own JavaScript Library: Premium Series
Download Source Files
Over the course of the past few years, the JavaScript community has exploded exponentially. It it’s safe to assume that libraries are the primary reason we’ve seen such astonishing growth. Thanks to these libraries, the differences between the popular browsers are minimized, making cross-browser development much easier than it used to be. We’ll build our own in this series!
Become a Premium member to read this kick-butt tutorial and screencast series, as well as hundreds of other advanced tutorials and screencasts.
Included in this Two-Part Series:
- A full, in depth, written tutorial for each lesson.
- For visual learners, the same tutorial, in video form – hosted by Jeremy McPeak
- Each lesson’s source code
Join Net Premium

For those unfamiliar, the family of Tuts+ sites runs a premium membership service. For $19 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from Nettuts+, Psdtuts+, Aetuts+, Audiotuts+, Vectortuts+, Phototuts+, and CgTuts+ For the price of a pizza, you’ll learn from some of the best minds in the business. Become a Premium member to read this tutorial, as well as hundreds of other advanced tutorials and screencasts.


zaten hep bu tür yazılar paralı oluyor
Can you upload to the tuts+ marketplace?
and I would like to hear more about the result of this video tutorial – what the javascript library will contain?
I am trying to login to my Tuts+ account from past 5 days, but i can’t login.
I am using the correct username and password, I already created 3 tickets, but haven’t heard any replies yet., Please help me. username : idhruv
Hey Dhruv,
Oh no, that’s not good! BTW, I’m Drew, the Envato Support team manager. No worries, send me an email via my profile page here – http://themeforest.net/user/creatingdrew (assuming you have a marketplace account, if you register one you’ll be able to contact me via that page) with the ticket ID and details on your issue. We’ll get any issues fixed up for you! ;)
For those who may be interested in learning more, Alex Young of DailyJS (an awesome JavaScript blog) has put together a free eBook on how to build a JavaScript framework as well:
http://dailyjs.com/2010/12/02/framework-review/
Cheers,
Brian
Awesome tut, thanks for making!
I had a question when I was watching, though. I haven’t finished it yet, so if it gets answered later, sorry about that!
When you are referring to:
document.attachEvent(“onclick”, foo);document.detachEvent(“onclick”,foo);vsdocument.addEventListener(“click”,foo,false);document.removeEventListener(“click”,foo,false);
Are these both “Dom-Level-0″ event handlers? You say that the listener event handlers are basically like the attach and detach event handlers, except they have support for the bubbling and stuff like that.
So, if I only want to support the modern browsers (Chrome, Safari, Firefox, Opera) and IE, which one of these two do I use?
Also, the modern browsers (Chrome, Safari, Firefox, Opera) use a different set of handlers, correct?
Thanks!
I apologize for the sloppy code formatting.. I meant to write it out like so:
document.attachEvent(“onclick”, foo);
document.detachEvent(“onclick”, foo);
vs
document.addEventListener(“click”,foo,false);
document.removeEventListener(“click”,foo,false);
The ‘onclick’ event is Dom Level 0, attachEvent is IE specific, and addEventListener is the standard that most modern browsers (FF, Webkit, Opera, etc) use. To support modern browsers only, you’d need to use addEventListener and attachEvent.
http://net.tutsplus.com/tutorials/javascript-ajax/javascript-from-null-cross-browser-event-binding/ would be a good tutorial to watch to find out more.
I just heard about this cool site which allows you to pick from a menu of functions, objects, and classes to create your own javascript library. The site is at http://jpaq.org/ . This is what I think libraries like jQuery and Prototype should move towards.
Is this not the same tut as you get with joining in with the newsletter some weeks ago?
That was part 1, this is complete, two-part series.
What’s covered in part 2? There’s no information about that here anywhere, like with part 1 (which I can’t find anymore, so I assume you just joined them together).
Thanks :)
This is awesome.
Thanks Jeremy.
Thanks again for this tutorial !
At the end of part two it says “In Part III, we’ll add Ajax capability to our library, and we’ll start seeing how we can use our library to write some components”.
Will there be a part 3 any time soon?
Hopefully =)
I believe this line is not exactly correct:
else if (type === “object” && obj.nodeType !== “undefined” && obj.nodeType === 1)
Either undefined must be typed without quotes or typeof operator should be used.
Thanks.
You are correct. Thanks for spotting that.