ajax框架集

http://www.ajaxpatterns.org/AJAXFrameworks

AJAXFrameworks

From AjaxPatterns

Thanks to everyone who's let me know about the frameworks as they emerge. Please mail Michael Maheomff (mailto:michael@mahemoff.com) about any frameworks not yet here, or any corrections. (This is, for now, just a content management system rather than a true wiki.)

As a summary, the pure Javascript frameworks can be divided into two groups:

  • Infrastructural frameworks: provide basic piping and portable browser abstractions, leaving the content for the developer to create. Typical functionality:
    • Wrapper around XMLHttpRequest to encapsulate browser-server interaction. (All frameworks offer this).
    • XML manipulation and interrogation.
    • Performing DOM manipulation according to responses from XMLHttpRequest.
  • Application frameworks: may offer the above functionality, but are notable for including widget abstractions and other components which are more along the lines of desktop GUI frameworks.

And the server-side frameworks usually work in one of the following two ways (although they are classified according to language):

  • HTML/JS Generation: Server provides complete HTML/Javascript code generation and browser-server co-ordination, so that only browser-side coding is only for customisation.
  • Remote Invocation: Javascript calls routed directly to server-side functions (e.g. Java methods) and returned back to Javascript callback handlers. Or Javascript calls to server to extract information, e.g. session details, database queries.
Table of contents [hide]
[ edit]

Pure Javascript: Application Frameworks

[ edit]

DOJO (Under development; from September, 2004)

DOJO (http://dojotoolkit.org/) offers comprehensive widget and browser-server messaging support.

  • Framework for creation of custom Javascript widgets.
  • Library of pre-built widgets.
  • Browser-server messaging support - XMLHttpRequest and other mechanisms.
  • Support for manipulating URLs in the browser.
  • Open-source license (Academic Free License 2.1 (http://opensource.org/licenses/afl-2.1.php)). Led by Alex Russell (http://alex.dojotoolkit.org/) of JotSpot (http://www.jot.com/).
[ edit]

Open Rico (Under development; from May, 2005; based on earlier proprietary framework)

Open Rico (http://openrico.org/demos.page) is a multi-purpose framework with support for Ajax infrastructure and user interaction.

  • An XMLHttpRequest response can be routed to one or more callback operation, DOM object, or Javascript object.
  • Easy drag-and-drop.
  • Ajax animation such as scaling and transitions (and presumably the increasingly common idioms such as progress indicators and fading technique?)
  • "Behaviors" - Essentially a widget library.
  • Open-source. From Sabre Airline Solutions. By Bill Scott (http://looksgoodworkswell.blogspot.com), Darren James, and others.
[ edit]

qooxdoo (Under development; from May, 2005)

qooxdoo (http://qooxdoo.sourceforge.net/) is another ambitious framework with a broad range of UI and infrastructural features being developed.

  • Infrastructure:
    • Portable abstraction of the DOM and event/focus management.
    • Debugging support.
    • Timer class for easy scheduling.
    • Getter/Setter support
  • UI:
    • Widget framework and library of pre-built widgets.
    • Layout managers
    • Image caching and portable PNG transparency.
  • Open-source (LGPL). From various contributors.
[ edit]

Pure Javascript: Infrastructural Frameworks

[ edit]

AjaxJS (Raw alpha; from May 2005)

AjaxJS (http://ajaxpatterns.org/demo/liveSearch) is a basic threadsafe wrapper around XMLHttpRequest mainly for Ajax newcomers, still raw alpha and under development, only packaged with the AjaxPatterns live search demo for now.

  • RESTful calls to the server (GET/POST/PUT/DELETE) with plain-text or XML routed to a callback operation.
  • Destruction of used XMLHttpRequest objects.
  • Response caching (planned).
  • Aimed at Ajax newcomers - instead of optimising on performance or footprint, the library will aim to be a readable code base and will provide debugging support.
  • Open-source license. By Michael Mahemoff (http://softwareas.com) (with some ideas from John Wehr and Richard Schwartz).
[ edit]

HTMLHttpRequest (Beta; from 2001)

HtmlHttpRequest (http://www.twinhelix.com/javascript/htmlhttprequest/) is an alternative to XMLHttpRequest which uses IFrames for superior compatibility.

  • Tested and Works: IE6/Win, IE5.5/Win, IE5/Win, IE4/Win, Mozilla/Win, Opera7/Win, Safari/Mac, IE5/Mac.
  • Untested, Probably Works: IE4/Mac, Mozilla/Mac, Opera/Other, Konqueror/Linux. Are you using one of these? The author is requesting compatibility info.
  • Open source license (LGPL). By Angus Turnbull of Twin Helix Designs (http://www.twinhelix.com/).
[ edit]

Interactive Website Framework (Under development; from May 2005)

Interactive Website Framework (http://sourceforge.net/projects/iwf/) is a project aiming to support the various aspects of Ajax infrastructure in the browser. Describes itself as a "framework for creating highly interactive websites using javascript, css, xml, and html. Includes a custom xml parser for highly readable javascript. Essentially, all the plumbing for making AJAX-based websites, as well as other common scripts.".

  • Thread-safe XMLHttpRequest implementation
  • Wrapper around XML document, so you can make more readable code:
   var node = doc.groceries.frozen[0].pizza[0].size;</pre>

instead of manual navigation:

   var node = doc.documentElement.firstChild.firstChild.getAttribute("size");</pre>
  • Open-source license. By Weaver (http://circaware.com|Brock).
[ edit]

LibXMLHttpRequest (Released; June 2003)

libXmlRequest (http://www.whitefrost.com/servlet/connector?file=reference/2003/06/17/libXmlRequest.html) is a thin wrapper around XMLHttpRequest.

  • getXML() and postXML() methods.
  • Pooling of XMLHttpRequest objects.
  • Response caching.
  • Source available (obviously), but protected by standard copyright. By Stephen W. Coate (http://www.whitefrost.com/index.jsp).
[ edit]

RSLite (x)

RSLite (http://www.ashleyit.com/rs/main.htm) is a thin wrapper around XMLHttpRequest.

  • A simple component released as part of Brent Ashley's more comprehensive Remote Scripting work (see Javascript Remote Scripting - JSRS in Multi-Language Server-Side section).
[ edit]

Sack (In development; from May 2005)

Sack (http://twilightuniverse.com/2005/05/sack-of-ajax/) is a thin wrapper around XMLHttpRequest.

  • Caller can specifies callback function or callback DOM object. With a callback DOM, the response text is pushed directly into the DOM
[ edit]

Sarissa (Released; from February, 2003)

Sarissa (http://sarissa.sf.net) is a Javascript API which encapsulates XML functionality in browser-independent calls.

  • Portable XMLHttpRequest creation.
  • Portable XPath queries.
  • Portable DOM manipulation.
  • Portable XSLT.
  • Portable serialisation to XML.
  • Open-source (GPL 2.0 and LGPL 2.1. IANAL and wouldn't have a clue how it can be both at the same time.). From various contributors.
[ edit]

XHConn (Released; from April, 2005)

XHConn (http://xkr.us/code/javascript/XHConn/) is a thin wrapper around XMLHttpRequest.

  • Example:
new XHConn().connect("mypage.php", "POST", "foo=bar&baz=qux", fnWhenDone);
  • Open-source (Creative Commons Attribution-ShareAlike License). By Brad Fults.
[ edit]

Server-Side: Multi-Language

[ edit]

SAJAX (Workable but not 1.0; from ?March 2005)

SAJAX (http://www.modernmethod.com/sajax/) routes calls directly from Javascript into your server-side language and back out again.So, for example, calling a javascript method "x_calculateBudget()" will go the server and call a Java calculateBudget() method, then return the value in javascript to x_calculateBudget_cb().

  • Faciliates mapping from Javascript stub function to back-end operation.
  • Capable of stubbing calls to numerous server-side platforms: ASP/ColdFusion/Io/Lua/Perl/PHP/Python/Ruby.
  • Open-source license. From various contributors.
[ edit]

Javascipt Object Notation (JSON) and JSON-RPC

JSON (http://www.crockford.com/JSON/index.html) is a "fat-free XML alternative" and JSON-RPC (http://www.json-rpc.org/) is a remote procedure protocol, akin to XML-RPC, with strong support for Javascript clients.

[ edit]

Javascript Remote Scripting (JSRS) (from 2000)

JSRS (http://www.ashleyit.com/rs/jsrs/test.htm) routes calls directly from Javascript into your server-side language and back out again.

  • Known browsers: IE4+, NS4.x, NS6.x, Mozilla, Opera7 and Galeon.
  • Server-side support: ASP, ColdFusion, PerlCGI, PHP,Python, and JSP(servlet).
  • Open source (very flexible custom license). By Brent Ashley (http://www.ashleyit.com/).
[ edit]

Server-Side: Java

Note: Many existing frameworks have recently been adding Java support (e.g. struts), and I will link to those later on.

[ edit]

Echo 2 (from March 2005)

Echo 2 (http://www.nextapp.com/products/echo2/) allows you to code Ajax apps in pure Java (Demo (http://demo.nextapp.com/InteractiveTest/ia)).

  • Automatically generates HTML and Javascript.
  • Co-ordinates messages between browser and server. Messaging in XML.
  • Can hand-write custom Javascript components if desired.
  • Open-source license (Mozilla Public License or GNU LGPL). From Next App, Inc. (http://www.nextapp.com/).
[ edit]

Direct Web Remoting (DWR) (2005)

Direct Web Remoting (http://www.getahead.ltd.uk/dwr/) is a framework for calling Java methods directly from Javascript code.

  • Like SAJAX, can pass calls from Javascript into Java methods and back out to Javascript callbacks.
  • Can be used with any web framework - Struts, Tapestry, etc.
  • Follows Spring-like KISS/POJO/orthogonality philosophy.
  • Open-source license (Apache (http://www.apache.org/LICENSE.txt)). By Joe Walker (http://www.getahead.ltd.uk/sg/space/joe/). Being incorporated into next WebWork (http://www.opensymphony.com/webwork/) release.
[ edit]

Server-Side: Lisp

[ edit]

CL-Ajax

CL-Ajax (http://cliki.net/cl-ajax) directs Javascript calls directly into server-side Lisp functions.

  • Export functions as follows:
   (export-function #'my-function) 
  • Generates Javascript stub with arguments.
  • Can callback to Javascript function or DOM object.
  • May be integrated into SAJAX.
  • Open-Source (custom, very flexible, license). By [Richard Newman](http://www.holygoat.co.uk/).
[ edit]

Server-Side: .NET

[ edit]

Ajax.NET (Under development; from March 2005)

Ajax.Net (http://ajax.schwarz-interactive.de/csharpsample/default.aspx) is a library enabling various kinds of access from Javascript to server-side .NET.

  • Like SAJAX, can pass calls from Javascript into .Net methods and back out to Javascript callbacks.
  • Can access session data from Javascript.
  • Caches results
  • Free to use, source available, unspecified license. By Michael Schwartz (http://weblogs.asp.net/mschwarz/).
[ edit]

Server-Side: PHP

[ edit]

AjaxAC (From April, 2005)

AjaxAC (http://ajax.zervaas.com.au/) encapsulates the entire application in a single PHP class. From the website:

  • All application code is self-contained in a single class (plus any additional JavaScript libraries)
  • Calling PHP file / HTML page is very clean. All that is required is creating of the application class, then referencing the application JavaScript and attaching any required HTML elements to the application.
  • Built in functionality for easily handling JavaScript events
  • Built in functionality for creating subrequests and handling them
  • Allows for custom configuration values, so certain elements can be set at run time
  • No messy JavaScript code clogging up the calling HTML code - all events are dynamically attached
  • Easy to integrate with templating engine due two above 2 reasons
  • Easy to hook in to existing PHP classes or MySQL database for returning data from subrequests
  • Extensible widget structure to be able to easily create further JavaScript objects (this needs a bit of work though)

Background:

[ edit]

JPSpan

JPSPAN (http://jpspan.sourceforge.net/wiki/doku.php) passes Javascript calls directly to PHP functions.

  • Heavily unit-tested.
  • Open source license (PHP).
[ edit]

XAJAX

XAjax (http://xajax.sf.net) passes Javascript calls directly to PHP functions.

  • Use Javascript stub to call PHP script.
  • Open source. By J. Max Wilson.
[ edit]

Server-Side: Ruby

Ruby On Rails (http://www.rubyonrails.org/) is a general web framework with strong Ajax support

  • Rails was still in its early days when Ajax hype began, so Ajax may become increasingly core to the Rails framework.
  • Generates most/all of the Javascript for widgets and animation in the browser.
  • Support for calling server-side
  • Scheduling support.
  • Open source license (MIT or similar (http://wiki.rubyonrails.com/rails/show/License)). By David Heinemeier Hansson (http://www.loudthinking.com/) and contributors.
[ edit]

Credits

Writing this < 24 hrs after I added the page, there are already quite a few people to thank for suggestions and corrections. I'll add everyone together once the dust has settled.


评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值