动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 软件工程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ 软件工程 ]的信息

本月文章推荐
.微软软件开发技术二十年回顾.
.MSN/QQ爆诈骗狂潮 用户小心个人信.
.企业架构和SOA架构的角色将融合.
.对比JSF在Eclipse 和 NetBeans中.
.解析UML的静态建模机制(1).
.测试服务:SOA的完整性和扩展性.
.SOA扩展Web服务的前景(一).
.更好的控制客户需求.
.三谈多态—善用virtual.
.Deming的质量管理十大原则.
.XAML开发入门之用VS2005开发XAML.
.SOA架构中间件发展趋势调查分析.
.冷静面对SOA的中间件.
.用TAPI 3.0 建立呼叫中心.
.Windows 2000 Professional中用命.
.使用UDDI的Web服务描述和发现之一.
.软件项目管理的质量保证.
.面向服务的体系结构的成熟度模型.
.Apache APR可移植运行库简介(3).
.SOA面向服务架构的原则.

Yahoo! UI Libraries Target Cross-browser Web Development Woes

发表日期:2008-3-23 |


URL:http://www.devx.com/webdev/Article/31225/0/page/2

The recently released Yahoo! UI libraries provide cross-browser DHtml and AJAX capabilities with a commercial-friendly BSD License. Unfortunately poor documentation, verbose syntax, and incomplete capabilities mar the eXPerience. 

by David Talbot April 17, 2006

Yahoo! UI Libraries Target Cross-browser Web Development Woes(图一) ver since the 4.0 browsers were released, cross-browser dynamic HTML libraries have proliferated as a simple matter of necessity. Any developer who wants to take advantage of the latest and greatest HTML/javascript capabilities while maintaining cross-browser compatibility has probably developed something of a library of "hacks" to normalize the API between the warring and buggy browsers.

Overall, Yahoo provides a decent library for general cross-browser hacks, but unfortunately, the effort doesn't measure up to some of the other open source APIs available sUCh as DynAPI. You can download the free Yahoo! UI (YUI) libraries and experiment with them yourself.

A Quick Tour
After you've downloaded YUI and extracted the .zip file, you'll find the extraction creates eight folders, each with a similar sub-folder structure. Each folder contains several subfolders, but the only ones of interest are:

  • The build folders, which contain just the files you'll need to use the functionality.
  • The example folder that shows the functionality in action.
I wouldn't recommend bothering with the source Directories as these contain some .js files that also exist in combined versions in the build directories, no douBT created by a utility they didn't include in the package nor reference on their Web site.

Overall, YUI is basically a function library that you Access through a combination of anonymous methods and "namespace-like" syntax. For example, if you wanted to set the X/Y location of an element on the page, instead of writing code such as SetLayerLoc('MyID', 10, 10), you would instead make a library call as follows:


YAHOO.util.Dom.setXY('MyID', new Array(10,10));
Although YUI gets the job done, the syntax is thoroughly verbose.

The documentation consists of some Javadoc-like API reference that was automatically generated from some sort of automated tool with no effort to clean it up or add useful detail to the generated class descriptions. It does include a fairly complete set of examples that go through most of the common functions in a reasonable and straightforward way, but without any linkages to or from the rest of the generated documentation.

The DOM and Event Libraries
YUI's capabilities in regard to core DOM and event handling are incredibly rock-solid, perform as expected, and cover a broad range of capabilities. Most surprisingly, this API gives you simple cross-browser transparency control. Most developers aren't even aware that magic tricks even exist (via DirectX calls) to make semi-transparency work in IE, much less the Mozilla-based equivalents, but YUI enables access to most, if not all, of the Css properties you'd ever want. Here's an example:

YAHOO.util.Dom.setStyle('MyDivID', 'opacity', .5);
The caveat of so many of these wonderful capabilities is again the documentation. The documentation implies that you can set the CSS style properties on all elements using their JavaScript equivalent names, for example, by writing backgroundColor rather than the CSS equivalent background-color, but the downside is that it lacks a full list of supported properties.

After you realize YUI has an amazingly cool cross-browser hack to enable transparency, your hopes will briefly rise that perhaps the libraries also implement cross-browser hacks to save you from having to remember every CSS hack around non-standard CSS properties. Unfortunately this isn't the case. Upon further inspection of the code you'll discover that the transparency hack is the only CSS hack supported by YUI—all other setStyle calls are passed directly through to the browser's DOM unchecked.

Fortunately, the event API is deeper than the DOM API and includes functions to normalize many of the cross-browser events. It normalizes the API to the more standards based addListener/removeListener functions.

Overall, the DOM and Event libraries do the job but require verbose syntax to accomplish what other libraries do with half the typing.

Animation API
The animation API is where the framework starts to provide real value. The approach of the API is to define a series of from and to key states as well as the duration the animation should last from start to finish.

Among the properties you can animate are: color transitions, location, size, and opacity. You can create fascinating displays with relatively little effort in a manner similar to the Dreamweaver JavaScript. However, these API capabilities are only truly useful if you know the precise path of your animation at design time, because the declarative syntax used makes it difficult to alter animation paths at runtime.

Drag and Drop
Drag-and-drop support has always been an area of divergence among browser implementations. YUI does a masterful job of not only smoothing out the differences but adding some great functionality on top of it.

The Drag and Drop API provides a lot of advanced functionality not seen in other freely available JavaScript libraries. The end user experience with YUI drag-and-drop elements is very slick. You can specify what items are draggable and what items are drop targets in a relatively simple, though verbose, way.

I would have liked to have seen YUI behave a little more like some of the other freely available libraries out there in terms of associating drag sources with possible drop targets. In YUI you have to write code (there's an example in the documentation) to specify drop targets as opposed to simply adding grouping tags to your targets as you can with Script.aculo.us.

Connection API
Remote scripting has been around for years but when Google launched Google maps it set the Internet afire with AJAX mania. The mania is of course well-founded, because AJAX can offer a dramatic user experience improvement. The result of this mania has been a tremendous proliferation of libraries that normalize the interface to the underlying browser hacks that enable you to make a round trip to the server for more data without refreshing the browser.

YUI provides a reasonably complete API for remote scripting. It includes the ability to make remote calls, handle successes, and handle failures. If you're using a server-side language that does not yet have a client side API for remote scripting, YUI is pretty good choice.

The code example below highlights the relative simplicity of the YUI connection libraries.


var handlers = {
success: success,
failure: failure }
function success(t)
{ alert('Yea, success'); }
function failure(t)
{ alert('Awww.'); }
YAHOO.util.Connect.asyncRequest('GET',
'http://mysite.com/Remote.ASPx?GetPage=1',
handlers,null);
Despite the fact that the connection library is one of the strong points of YUI, I would still recommend sticking with whatever AJAX libraries are specifically designed for your server-side language. The reason for this is simple—consistency in data type handling will reduce the overall amount of effort required to achieve the desired result. However, if you work in a multi-language or multi-platform environment, the YUI connection library is the better choice.

To be completely honest, I rewrote this article after my initial review. I had half of my review written based on playing with a few of the examples but repeatedly found myself disappointed with so many facets of the library that I had to delete the first article attempt and try again. Overall, YUI is filled with verbose syntax and undocumented bizarre parameter options. Personally, as a .NET man, I'll stick with writing good xbrowser DOM, using DynAPI for event normalization and ATLAS for my AJAX needs.

In sum, the YUI libraries attempt to provide a complete cross-browser DHTML and AJAX API, but while parts of the libraries are rock-solid and work well, the attempt falls short in a few areas and fails miserably in its overall syntax.

Page 2 of 2
Yahoo! UI Libraries Target Cross-browser Web Development Woes(图二)
Yahoo! UI Libraries Target Cross-browser Web Development Woes(图三)Yahoo! UI Libraries Target Cross-browser Web Development Woes
Yahoo! UI Libraries Target Cross-browser Web Development Woes(图五) David Talbot is the vice president of development for Data Systems International, a company that develops case-management software for the social services industry. His experience ranges from license-plate recognition using neural networks to television set-top boxes to highly scalable Web applications. He is also the author of Applied ADO.NET.
上一篇:Objects as associative arrays 人气:306
下一篇:ASP 分页操作改良版 人气:1509
浏览全部软件工程的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-10-10 企业网站智能管理系统(TZIMS) v6
2008-10-10 拓文asp.net网站内容管理系统 v6
2008-10-10 动网论坛PHP版 v2.0++ Build 081
2008-10-10 免费时代CMS v5.0
2008-10-10 wodig第四季中文DIGG社区 v4.1 b
2008-10-10 老Y文章管理系统 v2.2 bulid 081
2008-10-10 魔法盒动感相册 ASP+SQL版 v2.0
2008-10-10 Asoft签到管理系统 v3.0 Pack1
2008-10-10 哥特人音乐网潮流留言本 v1.1
2008-10-11 联系人分组工具 v1.1 中文破解版
2008-10-11 FaceMelter变脸 v2.0 汉化破解版
2008-10-11 PathTracker道路跟踪仪 v1.2 破解
2008-10-11 Rooms手机聊天室 v0.6.7 破解版
2008-10-11 RemoteDesktop远程桌面 v1.0 破解
2008-10-11 ProRemote远程调音台 v1.0.1 破解
2008-10-11 PicShare照片共享 v1.0.0 破解版
2008-10-11 Photogene照片编辑器 v1.5 汉化破
2008-10-11 WriteRoom共享文档 v1.0 破解版
  发表评论
姓 名: 验证码:
内 容:
站长工具:网站收录查询 | Google PR查询 | ALEXA排名查询 | CSS在线编辑器 | 广告代码 | js/vbs加密 | md5加密 | 进制转换 | UTF-8 转换工具 | Html转换js | Html转换asp | Html转换php | Html转换perl
实用工具:汉字翻译拼音 | 拼音字典 | 符号对照表 | 个税计算 | 实时汇率查询换算 | 经典小工具 | 汉字简繁转换 | 普通单位换算 | 公制单位换算 | 生辰老黄历 | 国内电话区号 | 国家代码与域名缩写 | 文字加密解密 | 健康查询 | 万年历 | 汉字横竖排版 | 手机号码查询 | 计算器 | ip搜索
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報
防水工事·改修工事 フットサル大会 探偵
SEO対策 中国語教室 ホームページ作成