Smashing Magazine - we smash you with the information that will make your life easier. really.

40 Useful JavaScript Libraries

Advertisement

Popular JavaScript libraries such as jQuery, MooTools, Prototype, Dojo and YUI can be great for accomplishing common JavaScript tasks. These libraries provide many functions, whether the matter is related to events or effects or AJAX. And if one of these libraries can’t do the job, a plug-in probably exists that can.

Such flexibility is great but sometimes comes with a penalty (the size of JavaScript files being one of them). Although adopting a well-known JavaScript library is usually a wise decision, you may want to perform a task that can be accomplished by a more lightweight library dedicated exclusively to that task or that is not supported by the more popular JavaScript libraries.

Below, we present 40 stand-alone JavaScript libraries that serve specific purposes. These are not all the ones out there, but every Web designer or developer will find something helpful here.

[By the way, did you know there is a brand new Smashing Wordpress Book? Push WordPress past its limits and take the basic blog into an entirely new blogosphere.]

1. Forms

wForms
wForms is an open-source and unobtrusive library that simplifies the most common JavaScript form functions. It offers ready-to-use form validation functions for which can be applied by adding a class info to the form objects. Besides these, wForms has powerful form synchronization (like “Check”/”Uncheck all”) and conditional form capabilities (e.g. if x is checked, then show y).

Wforms in 40 Useful JavaScript Libraries

Validanguage
Validanguage is an unobtrusive JavaScript form validation framework. It has an inheritance logic whose settings can be defined globally, per form or per element. With the 2 APIs provided: and features like integrated AJAX support, caching and callback functions, the framework provides a robust validation experience. It has a HTML-like API inserted in comment tags and a JavaScript object-based API, for advanced configuration.

Validanguage in 40 Useful JavaScript Libraries

LiveValidation
LiveValidation is a lightweight library that equips you with set of validation functions. Besides the classic validation methods, the library has a powerful live validation feature that controls the fields as you type. Ruby on Rails developers will find it very easy to use because the naming conventions and parameters are very similar. It is a stand-alone library but has a Prototype version, too.

Live-validation in 40 Useful JavaScript Libraries

yav
A powerful, extensible and flexible form-validation library, yav has support for a wide range of scenarios, from basic ones like date, email and integer, to advanced ones, like masking and custom regular expressions. It has built-in AJAX support, and errors displayed can be easily customized per object level.

qForms
A complete solution for handling forms. It equips a developer with features such as various validation rules, methods to prevent multi-submissions, ability to lock/disable fields and more.

formreform
Using multi-column layouts without tables is usually challenging. This tiny library transforms a classic form into a stylish layout with one, two or four columns. Forms are styled to fit any design automatically with formreform.

Formreform in 40 Useful JavaScript Libraries

2. Animation

$fx()
$fx() is a lightweight library for animating HTML objects. Using it, you can alter any CSS property within a given timeline. For complicated animations, you can combine effects, group them to chains and run them in parallel. And you can set different callbacks at every step to customize it further.

Fx-javascript-animations in 40 Useful JavaScript Libraries

JSTweener
A tweening library for JavaScript. Its API is similar to the famous ActionScript tweening engine Tweener. You can mention the time of the animation, define the transition effects and delays. At almost any point (like onStart, onComplete, onUpdate) you can fire new events.

Jstweener in 40 Useful JavaScript Libraries

Facebook Animation
A powerful library for creating customizable CSS-based animations. With a line or two in Facebook Animation, you can improve the UI. The syntax is identical to the FBJS version (the library used in Facebook applications) and once learned, it is an asset for creating Facebook applications.

FX
A lightweight library, with a YUI-like syntax, FX can create a tween for almost any CSS property. It supports color and scroll animations. Designing the “to” and “from” values of any object/property is enough.

3. Visualization And Image Effects

JS charts
JS charts supports bar charts, pie charts and simple line graphs. It offers nice usability by simply inserting the library onto Web pages and calling the data from an XML file or a JavaScript array. Charts are created as PNG files and the library is compatible with all the major browsers.

Js-charts in 40 Useful JavaScript Libraries

Canvas 3D JS Library (C3DL)
C3DL makes writing 3D applications easy. It provides a set of math, scene and 3D object classes to make the canvas more accessible to developers who want to develop 3D content in a browser but not have to deal in depth with the 3D math needed to make it work.

C3dl in 40 Useful JavaScript Libraries

Processing.js
This is a JavaScript port to the Processing language (a language for programming images, animation and interactions). The library is feature-rich for creating 2D outputs. It provides methods for shape/image drawing, color manipulation, fonts, objects, math functions and more.

Processing-js in 40 Useful JavaScript Libraries

Raphaël
An amazing library that simplifies working with vector graphics on the Web. Raphaël uses SVG and VML for creating graphics that can be modified and event handlers that can be attached to them. The library is feature-rich in functions, including rotation, animation, scaling and drawing curves, rectangles and circles.

Raphael-js in 40 Useful JavaScript Libraries

ImageFX
This is a JavaScript library for adding effects to images, like blur, sharpen, emboss, lighten and more. ImageFX uses canvas element for creating the effects. It is compatible with all major browsers (there is a compatibility chart on the script’s page). The library is so easy to use. Simply inserting the .js file in the Web page and calling a one-line function is enough.

Imagefx in 40 Useful JavaScript Libraries

Pixastic
Pixastic uses the HTML5 canvas element, which enables accessing raw pixel data. The effects supported include desaturation and grayscale, inverting, flipping, brightness and contrast adjustment, hue and saturation, embossing, blurring and much more. Because the canvas element is relatively new, the library does not have equal support in all browsers yet.

Reflection.js
An unobtrusive JavaScript to auto-create reflection effects. The height and opacity of the reflection can be defined. Using it is as easy as adding a “class” to the images. It works in all major browsers and is smaller than 5 KB.

Reflection-js in 40 Useful JavaScript Libraries

4. Database

Taffy DB
A JavaScript library that can be thought as an SQL database in the browser or an advanced “array manager.” It works as a database layer within AJAX’ed Web applications. You can create, read, edit and delete data, use loops, sort them and use advanced queries.

ActiveRecord.js
This library supports Google Gears and Chrome, Aptana Jaxer, Adobe AIR, and any platform that supports W3C HTML5 SQL Specification (Webkit and iPhone for now). It makes it easy to work with databases in JavaScript. Using ActiveRecord.js, you can auto-create tables, validate and synchronize data and more.

Activerecord-js in 40 Useful JavaScript Libraries

5. String And Math Functions

Date.js
Working with dates are always tricky. So many dots, slashes and formats. Datejs is a stunning library for simple to complex date functions. It can parse dates like: “Next thursday”, “+2 years” and all formats like 2009.01.08, 12/6/2001 etc.

Datejs in 40 Useful JavaScript Libraries

Sylvester
This is a JavaScript library for doing vector and matrix math easily, without using a lot of loops and getting lost between arrays. It includes classes for modelling vectors and matrices in any number of dimensions and for modelling infinite lines and planes in 3D space.

Sylvester in 40 Useful JavaScript Libraries

Pretty Date
A smart JavaScript solution for displaying dates within the past month in a prettier and more user-friendly way. It displays dates relative to the current time; for example, “Yesterday,” “3 hours ago,” etc.

Pretty-date in 40 Useful JavaScript Libraries

XRegExp
Regular expressions can be already used in JavaScript with the RegExp object. XRegExp adds more power to RegExp with features that will be part of the browsers of tomorrow (according to proposals for ECMAScript 4 – ES4). Using the library, RegExp objects can be cached and reused, modifiers can be added to existing RegExp objects and more.

JavaScript URL Library
A library for handling and manipulating URLs more easily. It is possible to reach every part of a URL as a string and modify it when needed. This URL library is very new but already works as mentioned.

6. Fonts

typeface.js
An unobtrusive library for using any font on a website. Unlike popular solutions like sIFR or FLIR, typeface.js doesn’t require Flash and is 100% JavaScript. To use any font, upload the TrueType font file to a Web-based generator, and download the rendered JavaScript file and include it in your Web pages.

Typeface-js in 40 Useful JavaScript Libraries

Cufón
Very similar to typeface.js, Cufón enables you to use any TrueType font in a website. Again, it converts the font to VML with a generator. After inserting the generated .js file in your Web pages, you can use the font like any other.

7. Debugging And Logging

Blackbird
Alert()s are widely used to create checkpoints in JavaScript development. Blackbird offers a stylish console to log, view and filter messages in JavaScript, which quickens the development process by eliminating the pause at every alert and analyzing each better.

Blackbird in 40 Useful JavaScript Libraries

NitobiBug
A browser-based, cross-browser JavaScript object logging and inspection utility. By inserting rules in your code (like which object to follow), you can have it distinguish between simple types, like strings, booleans and numbers, and complex objects, like error messages and objects.

Nitobibug in 40 Useful JavaScript Libraries

Firebug Lite
Firebug, which sadly only works with Firefox, is one of the best debugging tools around. To have a similar tool for all browsers, insert the Firebug Lite .js file into your Web pages, and you get the functionality and interface you’re used to.

Firebug-lite in 40 Useful JavaScript Libraries

8. Other

swfobject
swfobject is the most popular and flexible method for embedding Flash movies. It is unobtrusive, generates valid markup and can detect the version of a user’s Flash Player, allowing you to display alternate content if the required Flash version is not loaded. A nice article on “why swfobject should be used” can be found here.

Swjobject in 40 Useful JavaScript Libraries

sorttable and dragtable
Tables, like them or not, are still one of the best ways to present data. But they can be better: sorttable is a library that makes tabular data sortable, both ascending and descending. To do this, simply add class=”sortable” to the table. You can also exclude certain columns from being sorted and make either ascending or descending the default behavior. dragtable is another library that makes columns draggable. After inserting the library in the Web page, add class=”dragtable” to the table as above. Best of all, both libraries can be used together. Simply add class=”sortable dragtable” to the table after including both libraries in the Web page.

DD_roundies and DD_belatedPNG
DD_roundies is a great JavaScript solutions for creating rounded corners without using images. It is focused on IE and supports it through VML. Other browsers are ignored because they support CSS’s border-radius property.

Javascript-round-corners in 40 Useful JavaScript Libraries
DD_belatedPNG is a library that provides a customizable fix for the notorious IE6 PNG problem. Whether the PNG is used as “src” or “background-image” DD_belatedPNG can fix it. Unlike other solutions, “background-position” and “background-repeat” properties work as expected too.

Custom JavaScript Dialog Boxes
A lightweight library (about 4.5 KB) for creating custom dialog boxes. Four boxes can be displayed: alerts, warnings, prompts, success. With a simple function, you can specify the title of the box, the content to be shown and how many seconds to show it for.

Custom-dialog-boxes in 40 Useful JavaScript Libraries

GameJS
GameJS is a JavaScript-ported version of Microsoft’s XNA Game Framework that uses “canvas” as the rendering device. JavaScript is not the best platform for creating games. But for games with less FPS, and if you are a JavaScript developer, then why not? The library includes handy classes for controlling the objects, drawing and keyboard controls.

Gamejs in 40 Useful JavaScript Libraries

Shortcuts.js
Starting with Google Reader and Gmail, keyboard shortcuts in Web applications have become popular because they improve usability so much. Shorcuts.js provides functions to handle keyboard shortcuts more easily. Using the library, it is possible to create hotkeys and run functions at the press of a button.

Mapstraction
There are several mapping providers that provide different APIs. If you need to switch providers (say from Google Maps to MapQuest), codes need to be updated. That’s where Mapstraction comes in. It provides a common API that covers most of the popular mapping providers. By simply updating a line of code, it is possible to switch between them.

Mapstraction in 40 Useful JavaScript Libraries

Amberjack
A tiny JavaScript library (about 4 KB) that helps you add good-looking website tours to your website. Once activated, a modal box guides users by displaying any type of content. The steps in the tour can be hand-coded or generated online. Also, tours can be made to match the look of the modal box, either via CSS or with a ready-to-use theme.

Amberjack in 40 Useful JavaScript Libraries

JsLoad
Remote loading API of JavaScript library. JsLoad is simple API that enables you to import big JavaScript libraries from Google server. JsLoad load dependencies of any version of the library automatically.

(al)

Umut Muhaddisoglu is a Web designer/developer. He runs WebResourcesDepot, a blog presenting free Web design and development resources everyday. To connect with the author, you can follow him on Twitter. http://twitter.com/umutm

Post Rating
1 Star2 Stars3 Stars4 Stars5 Stars (No votes yet)
Loading ... Loading ...

Tags: , ,

Advertising
  1. 1
    Jon
    March 2nd, 2009 7:39 pm

    Thanks for the article… will definitely use the js for image related tasks in the future

  2. 2
    Hayes Potter
    March 2nd, 2009 7:45 pm

    very nice list, great job

  3. 3
    Nazmy
    March 2nd, 2009 7:45 pm

    Love this post!

  4. 4
    Ty
    March 2nd, 2009 8:06 pm

    Great post!! will dig deep into this list tomorrow while at work. Wish it was up earlier b/c I just finished up some form validation. Good stuff!!

  5. 5
    Pop
    March 2nd, 2009 8:30 pm

    thank you SM

  6. 6
    Mukesh
    March 2nd, 2009 8:44 pm

    Nice post…………..very helpful to use in daily routine task….

    thanks Umut

  7. 7
    Timothy
    March 2nd, 2009 9:07 pm

    Some good ones on here. Thanks a bunch!

  8. 8
    Nidhi Agrawal
    March 2nd, 2009 9:29 pm

    Great post!

    1 thing: the Firebug lite under point 7 is wrongly linked to nitobibug

  9. 9
    Alvin L. Villaflores
    March 2nd, 2009 9:36 pm

    How about Microsoft’s Ajax Library? It’s nice for creating classes, introduce Ajax functionalities, and others.

  10. 10
    Pravin
    March 2nd, 2009 10:13 pm

    really good post.

  11. 11
    Brandon Hansen
    March 2nd, 2009 10:37 pm

    I am so glad that javascript has gotten beyond the days of copy/paste “snippets” of junk code. Finally there are some great resources out there that validate and are cross-browser friendly. Thanks for this awesome resource post.

  12. 12
    Ritesh
    March 2nd, 2009 10:42 pm

    Good list. Thanks!!

  13. 13
    Creamy CSS
    March 2nd, 2009 11:10 pm

    Thanks a lot for that! Really, it’s very useful post for me,… appreciate your work! ;)

  14. 14
    bluedee
    March 2nd, 2009 11:20 pm

    what a good list, bro….:)

  15. 15
    Defi
    March 2nd, 2009 11:40 pm

    Tessekkürler that’s an awsome collection. I’d like to add Woollymitten’s ClassBehaviours javascript examples. http://www.woollymittens.nl

  16. 16
    Mhd Zaher Ghaibeh
    March 2nd, 2009 11:58 pm

    there is also another library which is like activerecord.js , its called JazzRecord (JazzRecord is ActiveRecord for JavaScript (ORM)) .
    i think you have to add it to the database section .
    find more about it JazzRecord.

    thank you for this nice article..

  17. 17
    da
    March 3rd, 2009 12:08 am

    PRO! Thanks …

  18. 18
    Jacob
    March 3rd, 2009 12:08 am

    The Pixastic link is wrong. It should be http://www.pixastic.com/

  19. 19
    GalalDev
    March 3rd, 2009 12:10 am

    thank you fo these libraries

  20. 20
    anders
    March 3rd, 2009 12:21 am

    thanks!

  21. 21
    dmw
    March 3rd, 2009 12:37 am

    As pointed out by Nidhi Agrawal above, the correct url for Firebug Lite is http://getfirebug.com/lite.html.

    HTH.

  22. 22
    liebesiech
    March 3rd, 2009 12:48 am

    Saves me a lot of time looking for this stuff on my own. Thanks!

  23. 23
    OverZero.it
    March 3rd, 2009 12:51 am

    Js Charts could be very useful… I’ll consider it for one of next projects.
    Useful list as usual, thank you!

  24. 24
    Austin
    March 3rd, 2009 1:20 am

    It appears that the last link to JSload is false. Even the description is for the reflection.js script.

  25. 25
    Perfecrflow
    March 3rd, 2009 1:41 am

    Sure I’m goona use JS charts

  26. 26
    John
    March 3rd, 2009 1:43 am

    Great post. Would have liked to see the ‘MadeByPi ColorUtils’ library in there too because it’s the best out there for manipulating colors.

    // new Hex(”#00CCCC”).toRGB();
    // new Hex(”#00CCCC”).toRGB().toHSV();
    // new RGB(255,0,0).saturation(-10);
    // new RGB(255,0,0).hue(10);
    // new Hex(”#00CC00″).range(new Hex(”#CC0000″), 10);
    // new CMYK(0,1,1,0). analogous();
    // new Hex(”#cc0000″).greyscale().websafe();

  27. 27
    Oliver
    March 3rd, 2009 1:44 am

    Nice collection of tools / utils, I will defiantly make use of these in the future. Thanks!

  28. 28
    aMUSICsite
    March 3rd, 2009 2:03 am

    Some great alternatives to using Flash there. Flash seems to be getting worse with each version and Java/Javascript seems the way forward.

  29. 29
    HeriNXI
    March 3rd, 2009 2:16 am

    it’s really help me, since i duno about scripting :)

  30. 30
    Anes Sabitovic
    March 3rd, 2009 2:17 am

    I don’t need any more Flash!

  31. 31
    Paddy
    March 3rd, 2009 3:12 am

    Cufon is a great pice of software. It makes embedding fonts really easy for the first time.
    I tried sifr before, but I always encountered some problems down the road. typeface.js however did not work at all for me.

  32. 32
    Craig
    March 3rd, 2009 3:59 am

    Huge list here, I wish I had more time to explore them all!

  33. 33
    Michael
    March 3rd, 2009 4:21 am

    Wow…what a nice list!
    Bookmarked it, since I haven’t got the time to investigate all of the interesting things right now.

  34. 34
    Sunilkumar
    March 3rd, 2009 4:28 am

    worthfull search!!
    thanks !!

  35. 35
    Shane
    March 3rd, 2009 4:38 am

    Kudos to the creators of these libraries – the things that can be achieved with them is amazing :)

  36. 36
    DKumar M.
    March 3rd, 2009 4:50 am

    Nice Compilation Umut….Although many of then is already known to us but other then that this list still comes in handy.

    DKumar M.

  37. 37
    Alex
    March 3rd, 2009 6:21 am

    T H A N K Y O U

  38. 38
    ChiefWakambi
    March 3rd, 2009 8:11 am

    Just yesterday I got this. Also Jquery libraries. http://www.moralfibre.co.za/2009/02/05/jquery-tips-tricks-resources/

  39. 39
    Jônatan Fróes
    March 3rd, 2009 8:31 am

    what a strange name!!!

  40. 40
    Nadun
    March 3rd, 2009 9:38 am

    Great one, thnx a ton…

  41. 41
    Kwaa
    March 3rd, 2009 9:59 am

    Thanks, gave me a couple of ideas for my site. Cheers.

  42. 42
    Lipton of Starfeeder
    March 3rd, 2009 10:31 am

    3. Visualization And Image Effects

    Is amazing! Thanks for the links again Smashing Magazine :)

  43. 43
    myows
    March 3rd, 2009 11:20 am

    this is great thanks – a few i hadn’t even heard about !

  44. 44
    Wade Jackman
    March 3rd, 2009 11:55 am

    excellent post! There are a few on there Im not too familiar with, will have to investigate! Thanks!

  45. 45
    Brian Gottier
    March 3rd, 2009 11:56 am

    The form libraries look useful. I hadn’t ever heard of those, because I do my validation with php, but I sometimes will do both client side and server side validation. We should all know that JS is basically useless/dangerous for REAL form validation.

  46. 46
    Matt Penfield
    March 3rd, 2009 12:01 pm

    wow! IE firebug alone would make for a great post, but this is so full of amazing stuff i’ve been forwarding links to it all day

  47. 47
    LynxGirl
    March 3rd, 2009 12:16 pm

    Awesome list of tools!

  48. 48
    simon
    March 3rd, 2009 1:35 pm

    Great post, almost too many js tools to digest.

  49. 49
    nasip
    March 3rd, 2009 7:16 pm

    great post.

  50. 50
    aldur
    March 4th, 2009 2:09 am

    Like the look of blackbird so much I downloaded it

    thanks

    Aldur

  51. 51
    Bruno Natal
    March 4th, 2009 4:16 am

    Love all!

  52. 52
    Stefano
    March 4th, 2009 4:19 am

    Thank you very much, these libraries look very useful !

  53. 53
    Art
    March 4th, 2009 7:39 am

    That was nice I’m looking for this post.
    Thanks author

  54. 54
    Derek de Jong
    March 4th, 2009 10:26 am

    If you’re looking at making charts, I would suggest considering the Flot Plotting Library for jQuery. It has an unfortunate dependancy (jQuery), but the beauty, simplicity and extensibility of implementations make it a very serious competitior of other graph libraries. Just wish it would do “stacked” graphs.

  55. 55
    IgorSI
    March 4th, 2009 10:46 am

    Great list!

    For typeseting math equations on the web I recommend

  56. 56
    efecan
    March 4th, 2009 2:31 pm

    Everything I need is on this page. I can’t explain how it helped me. Teşekkürler Umut.

  57. 57
    hemin007
    March 5th, 2009 3:13 am

    谢谢,拿走研究去了。

  58. 58
    danilo di moia
    March 6th, 2009 6:21 am

    Thanks SM for this great post :)

  59. 59
    Alex
    March 6th, 2009 6:38 am

    Thank you for helpful article. Have a good weekend!

  60. 60
    Ariyo
    March 6th, 2009 11:54 am

    AWESOMENESS. Thanks a lot SM!

  61. 61
    tung
    March 9th, 2009 2:41 am

    Thanks for the share..

  62. 62
    Emre
    March 11th, 2009 4:30 am

    Great post and very well summarized. Hope to read more from Umut. Thanks.

  63. 63
    Ryan Morr
    July 3rd, 2009 9:09 pm

    I never did leave my thanks for including FX in this list, so… Thanks! Well I just released version 2 for the animation framework on my blog, check it out: http://ryanmorr.com/archives/fx-2-0-the-full-featured-animation-framework

  64. 64
    kombai
    July 14th, 2009 10:10 pm

    I have also another library which is like Taffy DB , its called Kombai
    I think you have to add it to the database section.
    You can download at http://vnjs.net/www/src/kombai.rar
    or check out from link
    http://kombai-js.googlecode.com/svn/trunk/ kombai-js
    Some demo code:
    //create new database
    K.create.database({

    fieldName : ["compare", "responseText", "responseXML"],
    primaryKey: “compare”,
    ignoreError: true

    });

    //update data
    oldRequest.Update({

    responseText: xhr.responseText,
    responseXML: xhr.responseXML,
    where: ‘compare == “‘ + code + ‘”‘

    });

    //select element in DOM
    var aImg = K.select({

    from: document.getElementById(’kombai’),
    where: “tagName ==’IMG’ && title == ‘copyright uoon’”

    });

    Thank you

  65. 65
    Hasan Can
    November 16th, 2009 2:10 am

    Syn. Umut Muhaddisoglu

    Burada bir Türk görmek beni çokk mutlu etti.

    Güzel bir derleme olmuş

    Selamlar.

  66. 66
    Olanrewaju Lawal
    December 12th, 2009 2:43 pm

    Am actually surprised no one has commented yet cos this post was really helpful…

  1. 00

    There are no trackbacks at this time. If you are interested in leaving a trackback, please use this URL.

Leave a Comment

Make sure you enter the * required information where indicated. Please also rate the article as it will help us decide future content and posts. Comments are moderated – and rel="nofollow" is in use. Please no link dropping, no keywords or domains as names; do not spam, and do not advertise!



Advertisement Advertise with us!
Join in Smashing Forum
Post your job