一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

SitePoint Blogs JavaScript Libraries and Patterns: Yahoo! Does AJAX

 weicat 2006-02-21

RSS ? Blog Post

Blogs » DHTML & CSS » JavaScript Libraries and Patterns: Yahoo! Does AJAX
 

JavaScript Libraries and Patterns: Yahoo! Does AJAX

by Kevin Yank

This is republished from The SitePoint Tech Times #132

JavaScript is hard, but it could be a lot harder. These days, choosing your tools can actually be most of the work.

Many, many years ago (okay, five), JavaScript code on a web site was a sign of a code-savvy developer with some extra time on his or her hands. Cute effects like mouseover image swaps (and not-so-cute broken right-click menus) were usually the result. Even on such technically adventurous sites, writing more than 100 lines of JavaScript code was virtually unheard of.

Today, the poster children of web application success consist of numerous beefy and interdependent JavaScript files with a light dusting of HTML and CSS. With JavaScript codebases easily outweighing markup and style sheets, should most of the sensitive, new age web developer’s time be spent scripting?

Well, unless you’re trying to solve a problem that no one has tackled before, the answer is “probably not.”

A great deal of energy in the web development arena is being put into building reusable solutions. Here at SitePoint, we just sent The JavaScript Anthology, nearly 600 pages of such solutions, to print. And today Yahoo! joined the growing number of entities offering libraries of reusable JavaScript functionality with the Yahoo! User Interface Library.

Meanwhile, the experiences that can be crafted using these rapidly evolving tools are growing richer every day. While the code monkeys keep pushing back the bounds of what’s possible, usability experts are compiling documentation on how best to create applications that people will be able (and willing) to use. The Yahoo! Design Pattern Library is a new and promising entry into this area.

In this post, I’ll run through Yahoo!’s new offerings for web developers and also review some of the other options you should be considering. If you haven’t picked your horse yet, now would be a good time. JavaScript is hard, but making use of it on your sites doesn’t have to be.

How to Do It: JavaScript Libraries

I’m a hand coder from way back. I take great satisfaction in crafting every part of a complex system with my own blood, sweat and tears. These days, however, it seems like I’m always reinventing the wheel when it comes to JavaScript.

Thankfully, there are some people out there who like reinventing wheels. Or rather, they like having the best wheels in town so that everyone will want to check out their sexy alloys, and get a set for themselves.

There are JavaScript libraries available to suit every taste. Here’s an overview of the most significant, including Yahoo!’s brand new offering:

Dojo

The Rolls Royce of JavaScript libraries, Dojo provides tools for every occasion. In fact, the library is so big that you probably won’t need to use every aspect of it in anything but the most complex of web applications. You can therefore choose to download the edition of the library with the features you are likely to need, and save your visitors from having to download the over 300KB of JavaScript code that makes up Dojo.

Dojo takes the unstable footing of the modern browser landscape and replaces it with a reliable set of interfaces. While Dojo handles the browser compatibility headaches, you get to write simple code for animation, event handling, remote scripting (AJAX), and tons more.

At its most powerful, Dojo lets you build browser-based user interfaces composed of widgets that provide all the interactivity of desktop applications. You can build your own widgets within the framework provided by Dojo, or use the library of built-in widgets. Dojo even provides sophisticated support for drag-and-drop, all without the headaches of ensuring browser compatibility.

Dojo’s downside is its complexity, and the fact that large parts of it are currently undocumented. Doubtless this will improve over time, but if you plan to get into Dojo today, expect to do a lot of learning by example.

Prototype

Rather than providing a whole new framework to build on the way Dojo does, Protoype enhances the existing JavaScript features of browsers so that they’re a lot less painful to use. With Prototype, you can leverage your existing skills while taking advantage of the clever shortcuts that the library provides.

In addition to invaluable shortcuts like the $ function, which is a shortcut for document.getElementById (e.g. $(‘content‘)), Prototype provides functions for event handling, array handling, form scripting, DOM manipulation and remote scripting (AJAX).

Because Prototype is so good at making low-level scripting less painful, a number of higher-level libraries have been built with Prototype as a basis. Most notably:

  • script. is the king of eye candy, offering easy-to-apply animated “cinematic effects” that can be used to enhance most web applications.
  • Rico aims at the same level as Dojo, providing everything you need to build desktop-like web applications out of a library of widgets. Unfortunately, it has even less documentation than Dojo.

AjaxTK

The Zimbra Ajax Toolkit (AjaxTK) was developed as the foundation for the web interface to Zimbra, a collaboration server that allows an entire company to manage email, calendaring and contacts and access it through the browser or through desktop clients like Microsoft Outlook. You can download AjaxTK separately for use in your own applications.

AjaxTK is in an awkward position right now, having one very impressive example of what it can do in circulation (the Zimbra web client), but not seeing much community adoption beyond that. With a recent announcement that AjaxTK would be contributed as the foundation for Apache Kabuki, an open source AJAX toolkit, its future is looking brighter.

At present, AjaxTK is heavily focused on building web applications with interfaces that are as rich as desktop apps. A full set of widgets, with a framework for building more, is provided.

Unlike most of its competitors, AjaxTK was designed so that you could embed widgets anywhere you like in a “normal” HTML document, or break out of the framework and render some “normal” HTML inside any widget. This ability to use the toolkit where you want and use more traditional methods elsewhere within a single application is perhaps AjaxTK’s biggest selling point.

Yahoo! User Interface Library

Announced only yesterday, the Yahoo! UI Library is still in its infancy, but with the momentum of Yahoo! behind it, it promises to be a very influential player.

If there is one thing to love about this library, it’s the documentation. From day one, every available component has full API documentation as well as a short “Getting Started” guide complete with working examples. No trawling through the developers’ blogs, no pulling apart complex applications: this toolkit has all the spit and polish of a commercial product.

For now, the library’s scope is somewhat limited. Beyond the core utilities for animation, remote scripting (AJAX), event handling, DOM manipulation, and drag-and-drop (which are certainly nothing to sneeze at!), the library currently offers only three actual widgets for building user interfaces:

  • Calendar for selecting dates
  • Slider for visually choosing from a range of values
  • TreeView for browsing through a hierarchy of items

Though the selection isn’t overwhelming, these three widgets alone already solve some problems that have traditionally taken a lot of work to overcome. No doubt future widget releases will address some of the more mundane needs of web application user interfaces.

It’s particularly refreshing to see Yahoo! opening up its box of goodies and sharing them with the web development community. This move contrasts sharply with Google’s approach of protecting its JavaScript assets by hiding them away in obfuscated code.

Of course, there are many other libraries besides the four that I’ve mentioned here, so if I’ve left out your favourite please don’t dismay. That said, I selected these four because of the community support, active development, and freedom they afford to the developer. If you think your library of choice belongs in this list, let me know why.

What to Do: Web Design Patterns

Just when I was getting my head around web design—logo at the top, navigation on the left, annoying Flash ad on the right—the new wave of web apps seem to be breaking all the rules. Suddenly there are new usability pitfalls everywhere you look. Thankfully, there are ways to learn from the mistakes of others.

Along with its UI Library, Yahoo! yesterday announced the publication of the Yahoo! Design Pattern Library, a collection of solutions for common web design problems. Here are a few of the patterns you’ll find in the library:

Each of these patterns has an animated screenshot showing a typical implementation of the pattern in use, along with point-form breakdowns of the problem it solves, the important details to get right in implementing the solution, the rationale behind these details, and the accessibility considerations of the solution.

Although the Yahoo! Design Pattern library only contains a handful of patterns right now (their announcement says 13, but I could only find 10), the library promises to expand in the near future as Yahoo! polishes up its internal documents for public consumption.

As with its UI Library, Yahoo! isn’t the first to produce something like this. There are a number of other great resources when it comes to web design patterns:

—patterns in interaction design offers some very slick patterns, though most of them apply only to traditional web design, rather than rich web applications. Of particular note are the “site type” patterns, which provide a list of design elements that are typically needed by sites of different types (e.g. a museum site).

Designing Interfaces is a polished collection of general user interface patterns, many of which apply to web design. These patterns were recently collected in the book Designing Interfaces by O’Reilly, for which this site is the companion.

Incidentally, SitePoint has a similar book on usability slated for release later this year that is specific to web design.

Finally, John Allsop’s WebPatterns site looks like a promising future home for community-produced web design patterns, but for now is only just getting off the ground (slowly).

In short, while the code monkeys will keep exploring the limits of the web, some real solutions are being produced by the likes of Yahoo! that are stable enough to use in everyday web development. Don’t get left behind!

Whether you dive into a new JavaScript library or explore some design patterns that apply to the type of work you do, now is a great time to infuse your web development skills with new life.

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多

    欧美国产日韩变态另类在线看| 日本丰满大奶熟女一区二区| 日本成人中文字幕一区| 东京热加勒比一区二区| 日本一区二区三区黄色| 久久福利视频视频一区二区| 亚洲精选91福利在线观看 | 人妻精品一区二区三区视频免精| 香港国产三级久久精品三级| 午夜福利视频偷拍91| 国产免费自拍黄片免费看| 五月婷婷缴情七月丁香| 欧美成人国产精品高清| 国产在线日韩精品欧美| 国产精品亚洲综合天堂夜夜| 久草视频这里只是精品| 亚洲精品成人综合色在线| 日韩在线一区中文字幕| 精品欧美一区二区三久久| 欧美一区二区三区视频区| 亚洲一区二区精品免费视频| 欧美日韩精品人妻二区三区| 欧洲亚洲精品自拍偷拍| 免费性欧美重口味黄色| 亚洲精品欧美精品一区三区| 国产又色又粗又黄又爽| 99久只有精品免费视频播放 | 中文字幕日韩无套内射| 午夜福利黄片免费观看| 国产精品熟女在线视频| 精产国品一二三区麻豆| 99一级特黄色性生活片| 美女露小粉嫩91精品久久久| 欧美黑人在线一区二区| 日韩人妻av中文字幕| 加勒比系列一区二区在线观看| 欧美老太太性生活大片| 欧美国产在线观看精品| 亚洲精品偷拍视频免费观看| 男女午夜视频在线观看免费| 国产av天堂一区二区三区粉嫩|