最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is there a general purpose JavaScript library out there? - Stack Overflow

programmeradmin3浏览0评论

We started a new project and realized that we needed a general purpose javascript library that contains a nice set of string functions, MD5, base64, allows extensions, etc. Also, copying and pasting functions from other libraries doesn't sound very attractive.

So, I guess the question is which javascript library contains the most general purpose functionality out there? or maybe there is a good collection of global functions out there we could use/extend. We know DOM manipulation is covered by many AJAX libraries including JQuery.

*Mind you, we could alternatively extend ExtJS, JQuery, etc. Is that what you guys are doing?

We started a new project and realized that we needed a general purpose javascript library that contains a nice set of string functions, MD5, base64, allows extensions, etc. Also, copying and pasting functions from other libraries doesn't sound very attractive.

So, I guess the question is which javascript library contains the most general purpose functionality out there? or maybe there is a good collection of global functions out there we could use/extend. We know DOM manipulation is covered by many AJAX libraries including JQuery.

*Mind you, we could alternatively extend ExtJS, JQuery, etc. Is that what you guys are doing?

Share Improve this question edited Feb 25, 2010 at 19:46 Alex Nolasco asked Feb 25, 2010 at 19:15 Alex NolascoAlex Nolasco 19.5k9 gold badges90 silver badges83 bronze badges 3
  • Also, do as much of this server-side as possible. The more you plicate your client-side script, the more browser patibility issues you're going to face. – 3Dave Commented Feb 25, 2010 at 19:18
  • Prototype, ExtJS and to an extent, Mootools provide decent string manipulation functions. – Chetan S Commented Feb 25, 2010 at 19:28
  • 1 In the case of JQuery, this code.google./p/jquery-utils gets closer ... – Alex Nolasco Commented Feb 25, 2010 at 20:19
Add a ment  | 

6 Answers 6

Reset to default 6

Google Closure Library

It contains (quoted from link):

a large set of reusable UI widgets and controls, and from lower-level utilities for DOM manipulation, server munication, animation, data structures, unit testing, rich-text editing, and more.

It also contains a nice set of string manipulating methods, in goog.string namespace.

Underscore

Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js

Underscore is intended to go along with other library, like jQuery or prototype. It's not extensible like jQuery or Google Closure, though.

*Mind you, we could alternatively extend ExtJS, JQuery, etc. Is that what you guys are doing?

Yes, I do and I think most are. A lot of what you describe as a "general purpose library" is covered by Frameworks like JQuery, Prototype or Moo. And short of clipping the webmaster's nails, there's a JQuery plugin for everything that's not already in the core.

Still, I'm interested to see whether any other "general purpose" libraries e up here. There are fields - like string manipulation, as stated in one of the ments to another answer, and advanced date operations - where none of these frameworks is the holy grail AFAIK.

I use the jQuery library and a bunch of plugins. jQuery's plugin directory contains a lot of useful tools. There's also jQuery UI, a set of interactive ponents and effects, which you can use if you don't want to use a more plex library like ExtJS.

Of course every project is different, and you will probably end up writing some helper functions on your own.

I realize that others are going to say the same, but jQuery truly amazes me every time I learn something new about it.

DOM, CSS, and event manipulation along with easy AJAX, extensibility, and the plethora of existing extensions make jQuery a wonderful tool for web development.

jQuery is incredibly useful for UI manipulation. However, being open source, it contains some less than optimal code. If you start running into performance issues, don't be afraid to delve into the source and see what's going on.

I have been using jQuery for some time now and that seems to handle most of the basic operations I need. It has a healthy library of plug-ins and you can always write your own. It is a very good lightweight js library and even if it doesn't do all that you need it to you it is a good starting point.

发布评论

评论列表(0)

  1. 暂无评论