473,698 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript Libraries... which one?

I have been looking into Javascript libraries for the last week or two
here, and there are certainly a lot of options out there.

http://www.prototypejs.org/
http://mootools.net/
http://mochikit.com/
http://script.aculo.us/

And then there are even add-ons to some of these, such as:

http://moofx.mad4milk.net/

I am just curious, is there a site out there that has examined all of
these libraries, and has made a feature and performance comparison among
them? Javascript isn’t my sharpest tool, by far, and I feel a little
overwhelmed examining the source code for these libraries.

I am looking to add a library to my repertoire of tools so that I can
enhance already existing content (I have no intention of making any
content JS-only capable!!), and as such, I am seeking some opinions or
actual rigorous examinations on which library might provide the best
spread of features.

As for my needs, I have no real intentions of supporting IE or Netscape
less than version 6, I am more interested in site effects than AJAX
(although this will probably change in the near future), and I am just
looking for any personal opinions about the Libraries. Such as bad
experiences, Library shortcomings, potential conflicts, etc.. Anything
constructive that you might be able to provide, that is.

TIA
...Geshel
--
*************** *************** *************** *************** *********
My return e-mail address is an automatically monitored spam honeypot.
Do not send e-mail there unless you wish to be reported as a spammer.
Please send all e-mail to my first name at my last name dot org, with
a subject-line of “NEWSGROUP REPLY FOR NEO GESHEL” (all uppercase).
*************** *************** *************** *************** *********
Feb 16 '07 #1
20 2152
On Feb 16, 10:47 am, Neo Geshel <got...@geshel. orgwrote:
I have been looking into Javascript libraries for the last week or two
here, and there are certainly a lot of options out there.

http://www.prototypejs.org/
http://mootools.net/
http://mochikit.com/
http://script.aculo.us/
You forgot http://developer.yahoo.com/yui/ ;)

I'm partial to the Yahoo lib for obvious reasons (I work for y! games,
so I may be a bit biased), but I've found it to be a very handy
library. Unlike prototype and (to a lesser extent) scriptaculous and
jQuery, it doesn't try to rewrite the syntax of the language, but just
extend it and sprinkle some sugar here and there. The yui connection
lib is one of the few that doesn't leak memory.

--i

Feb 16 '07 #2
Isaac Schlueter wrote:
On Feb 16, 10:47 am, Neo Geshel <got...@geshel. orgwrote:
>I have been looking into Javascript libraries for the last week or two
here, and there are certainly a lot of options out there.

http://www.prototypejs.org/
http://mootools.net/
http://mochikit.com/
http://script.aculo.us/
You forgot http://developer.yahoo.com/yui/ ;)

I'm partial to the Yahoo lib for obvious reasons (I work for y! games,
so I may be a bit biased), but I've found it to be a very handy
library. Unlike prototype and (to a lesser extent) scriptaculous and
jQuery, it doesn't try to rewrite the syntax of the language, but just
extend it and sprinkle some sugar here and there. The yui connection
lib is one of the few that doesn't leak memory.

--i
Thanks.

I haven’t had much of a chance to take a close look at it... doesit
have a getElementsByCl assName function?

Cheers,
...Geshel
--
*************** *************** *************** *************** *********
My return e-mail address is an automatically monitored spam honeypot.
Do not send e-mail there unless you wish to be reported as a spammer.
Please send all e-mail to my first name at my last name dot org, with
a subject-line of “NEWSGROUP REPLY FOR NEO GESHEL” (all uppercase).
*************** *************** *************** *************** *********
Feb 17 '07 #3
On Feb 16, 4:42 pm, Neo Geshel <got...@geshel. orgwrote:
Isaac Schlueter wrote:

You forgothttp://developer.yahoo .com/yui/;)

I haven't had much of a chance to take a close look at it... does it
have a getElementsByCl assName function?
http://developer.yahoo.com/yui/docs/...ntsByClassName

There's also a generalized getElementsBy that takes a function as the
first argument.

--i

Feb 17 '07 #4
Neo Geshel wrote:
http://www.prototypejs.org/
http://mootools.net/
http://mochikit.com/
http://script.aculo.us/
Add:
http://www.jquery.com/
http://developer.yahoo.com/yui/

I am just curious, is there a site out there that has examined all of
these libraries, and has made a feature and performance comparison
among them?
There are a number of them, and most of them are not a good analysis of the
situation. For example, google this:
http://www.google.com/search?q=javas...ibrary+roundup
Javascript isn't my sharpest tool, by far, and I feel a
little overwhelmed examining the source code for these libraries.
They are often written in a way to reduce the download size, even before
packing. And they take advantage of some of the lesser-known features of
Javascript. So they can indeed be difficult to understand, but if you have a
decent knowledge of js many of them are actually quite interesting to look
at.
I am seeking some opinions or
actual rigorous examinations on which library might provide the best
spread of features.
I haven't done a "rigorous" examination of the libraries, but I will offer
some opinions. As my experience and need for features may be very different
than yours, not all my points may be important to you.

Prototype:
It has been criticized in the past because it extended Object, which is a
javascript no-no. This has been fixed in version 1.5. The main gripes
against Prototype are that it tries to make JS into a class-based language
that it is not, and in doing so makes the syntax more confusing than it
would have been written in 'plain' JS. It is not very cross-browser or
standards-compliant. It is popular because it was one of the earlier
frameworks available, but I think it is reducing in popularity. It is used
heavily by the Ruby on Rails crowd and it tries to be Ruby-like. I would not
recommend Prototype. (Although your url is new to me - I didn't know it got
a new site for the version 1.5 launch).

MooTools:
This lib takes the approach of extending HTMLElement, which I particularly
like. It has a lot of functionality but it is broken up into many files and
can be hard to always know which files you need. In a recent discussion on
their support forum which I started, I was very much NOT impressed with the
team of developers. They had an elitist, unprofessional attitude. This led
me to not go with MooTools, even though technically their stuff is pretty
good. I found some glaring problems in the most recent release, although
some have been fixed in the development version. This lib was originally
based on Prototype and takes a class-based approach which is still not very
"JS-like".

MochiKit:
I haven't actually looked at this one at all. I have no idea.

Yahoo YUI:
This feels like a very "classical" library, in that the code is contained in
deep namespaces, it is organized by module, it is very verbose, and tries to
be a "do everything" library. I looked at it, but personally it never felt
right to me. Plus there were some glaring logic problems in some of the code
(don't know if they are fixed) so I wasn't sure how rigorously they tested.
I don't like their idea of "browser grades" and they seem to be keen on
browser detection. Nevertheless, it's very mature, extremely well
documented, has a lot of examples, and has a lot of support. Plus the power
of Y! behind it means it will probably still be relevant for years to come.

jQuery:
The popularity of this library seems to be growing, the documentation is
good, the examples are good, and the user community is fantastic. Rather
than extending HTMLElement, it uses the approach of a custom object that
holds on to an array of reference objects and can manipulate them. This
hopefully avoids memory leaks. It's small (19kb compressed) and packs in a
lot of features, they key being the ability to select elements by CSS
selectors. So if you want to do something with all DIVs on the page with
class "myclass" you just do $('div.myclass' ).doSomething() . The user
interface is handled by Interface Elements, which mirrors most of what
Moo.fx does. I ended up standardizing on this library as the basis for a
number of upcoming projects because the documentation is good, the user
community is great, the extensibility is great, the footprint is small, and
the plugins are growing. I plan to convert some of my own code into
jQuery-compatible plugins and to continue supporting this library in the
future.

Hope that helps!

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Feb 17 '07 #5
Matt Kruse wrote:
Prototype:
It has been criticized in the past because it extended Object, which is a
javascript no-no.
The problem with augmenting Object is that it causes incompetent programs to
break. I think the solution is to write competent programs, but I seem to be in
the minority. Also see http://yuiblog.com/blog/2006/09/26/for-in-intrigue/
Feb 17 '07 #6
On Feb 16, 8:37 pm, Douglas Crockford <nos...@sbcglob al.netwrote:
Matt Kruse wrote:
Prototype:
It has been criticized in the past because it extended Object, which is a
javascript no-no.

The problem with augmenting Object is that it causes incompetent programs to
break. I think the solution is to write competent programs, but I seem to be in
the minority. Also seehttp://yuiblog.com/blog/2006/09/26/for-in-intrigue/
But are you right that the hasOwnProperty( ) is a complete solution?

<URL: http://groups.google.c om/group/comp.lang.javas cript/msg/775698102c01a47 e>

Peter

Feb 17 '07 #7
Douglas Crockford wrote:
The problem with augmenting Object is that it causes incompetent
programs to break. I think the solution is to write competent
programs, but I seem to be in the minority. Also see
http://yuiblog.com/blog/2006/09/26/for-in-intrigue/
Your 'solution' starts out with limiting your test scope to make the desired
result easier to achieve:
"In all of the A Grade browsers ..." (Y!'s browser grading always rubs me
the wrong way)

What about older browsers? Using your approach of filtering out functions is
not good at all, since creating a method on an object is perfectly
acceptable and will work fine in older browsers. Other valid observations
appear in the comments to the article.

Unless you can identify a "defensive" solution that works in every case,
then I still think the recommendation stands to not augment Object. In
reality, there is no convincing reason to do so anyway.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Feb 17 '07 #8
Matt Kruse wrote:
Douglas Crockford wrote:
>The problem with augmenting Object is that it causes incompetent
programs to break. I think the solution is to write competent
programs, but I seem to be in the minority. Also see
http://yuiblog.com/blog/2006/09/26/for-in-intrigue/

Your 'solution' starts out with limiting your test scope to make the desired
result easier to achieve:
"In all of the A Grade browsers ..." (Y!'s browser grading always rubs me
the wrong way)

What about older browsers? Using your approach of filtering out functions is
not good at all, since creating a method on an object is perfectly
acceptable and will work fine in older browsers. Other valid observations
appear in the comments to the article.

Unless you can identify a "defensive" solution that works in every case,
then I still think the recommendation stands to not augment Object. In
reality, there is no convincing reason to do so anyway.
Had you read a little farther, you would have seen that the typeof function test
works in the antique browsers. It also works in applications which dredge the
prototype chain intentionally.

If you do not program defensively, then if your code has to run with other
people's code (which is common with libraries and mashups) then your code will
fail. In this case, your code fails simply because the other code exists. Useful
code should never be that fragile. And whether you understand it or not, there
are good reasons to augment Object.

http://javascript.crockford.com/
Feb 17 '07 #9
Douglas Crockford wrote:
Had you read a little farther, you would have seen that the typeof
function test works in the antique browsers.
Of course it does, but it also eliminates valid properties of an object
which happen to be functions. This isn't desireable, is it?
whether you understand it or not, there are good reasons to augment
Object.
I know it's useful, but it can also be avoided.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Feb 17 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

136
9379
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to use. The above URL is version 1.0 (draft) that resulted. IMO, it is not a replacement for the FAQ,...
23
2014
by: Matt Silberstein | last post by:
Are there any good qualities libraries out there, free or for "reasonable" cost? -- Matt Silberstein Do something today about the Darfur Genocide http://www.beawitness.org
1
1433
by: Liam | last post by:
We recently decided to go from cookieless to cookies, changing web.config to read cookieless=false. Since making that change, I've noticed that javascript functions kept in included libraries are not available. They'd been working for over a year. The libraries are included in the <HEAD> of the HTML page: <script language="javascript" src="../inc/utils.js" type="text/javascript"></script>
21
6047
by: petermichaux | last post by:
Hi, I've been asking questions about library design over the last week and would like to get feedback on my overall idea for a JavaScript GUI library. I need a nice GUI library so there is a good chance I will write this as I need new widgets. I haven't found anything like this and I'm surprised/disapointed this doesn't already exist. My library prototype works nicely. I think parts of these ideas are not commonly used for JavaScript...
8
2604
by: Frank | last post by:
Hi, I am working with VS.NET 2005 Ultimately, I wish to call a JavaScript function from a .js file
11
1563
by: v4vijayakumar | last post by:
Are there any simple javascript building blocks available? Like, Google web toolkit. But, I don't want to write code in java and then compiled into javascript. I am just looking for portable ajax/ javascript libraries. Thanks in advance.
61
3065
by: shapper | last post by:
Hello, I would like to use a javascript library to simplify my coding process. I know a few: JQuery, Dojo, Yahoo UI, ... Which one do you advice me to use? Thanks, Miguel
22
2921
by: Dan Rumney | last post by:
Hi all, I've been writing Javascript for quite a while now and have, of late, been writing quite a lot of AJAX and AJAX-related code. In the main, my dynamically generated pages are created using Perl on the backend, with Javascript providing limited frontend functionality. As an example, an expanding tree would be fully populated on the server-side and then presented to the browser, with Javascript and CSS being used to vary the...
24
2190
by: Aaron Gray | last post by:
From what I have been looking at for Javascript library development, browsers that support Javascript 1.5/ECMAScript 3/JScript 5.5 looks like the base level to pitch at. Anyone add anything ? Aaron
0
8672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4361
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3038
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.