Abput ajax

来源:互联网 发布:linux du命令排序 编辑:程序博客网 时间:2024/06/06 08:43

keywords:
unload 卸载 转储
open source 开源
remote procedure call 远程过程调用
intermedia layer 中间层
ajax engine ajax 引擎
plain text 明文
parse 语法分析
client server 客户 服务器
HTML 超文本标记语言
XML 可拓展的标记语言
css 连级风格表
XSTL 可拓展风格化表单语言转换
javascript 基于对象的脚本语言
interaction 交互

Suprred on by little known and lesser used technologies that had been inclueded in web browsers for some time, the web took a bold step forward, shattering the traditional usage model that required a full page load every time new data or a new part of the application’s logic was accessed. Companies began to experiment with dynamic reloading of portions of web pages, transmitting only a small amount of data to the client, resulting in a faster. and arguably, user experience.

Numbers open source and sommerical products began development to take advantage of this new web application model, these projects explained their technology using a varirty of term sunch as javascript remoting, web remote procedure calls. and dynamic updating, soon, however, a new term would emerage, it was ajax.

1.The real ajax
Despite the frequently asked questions attached to the end of garratt’s essay, some confusion still exists as to what ajax is, put simply, ajax is nothing more than an approach to web interaction, This approach involves transmitting only a small amount of information to and from the server in oder to given the user the most responsive experience possible.

Instead of the traditional web application model where the brower itself is responsible for initating requests to , and processing requests from, the web server, the ajax model provides an intermedia layer- what garrett call an ajax engine - to handle this communication, an ajax engine is really just a javascript object or function that is call whenever information need to be requesed from the server, instead of the traditional model of providing a link to another resource,each link makes a call to the ajax engine, which schedles and execute the request, the request is done asynchronously, meading the code execution doesn’t wait for a response before continuing.

The server which traditional would have serve up Html. images, css , or javascript is configured to return data that the ajax engine can use, this data can be plain text , xml, or any other data format that you may need, the only requirement is that the ajax engine can understand and interpret the data.

when the ajax engine receive the server response, it goes into actiion, often parsing the data and making serveral changes to the user interface based on the information it was provided , because the process involve transferring less information than the traditional web application model, user interface updates are faster, and the user is able to do his or her work more quickly, FIG 6-6 is an adaptation of the figure in Garrett’s article. displaying the difference between the traditional and ajax web application models.

2.techmologies behind ajax.
Garrett’s article mentions serveral technologies that he see as parts of an ajax solution,
Thers are
.html/xhtml primary content representation language,
.css provides styliestic formatting to xhtml
.dom dynamic updating of a loaded page.
.xml data exchange format
.xslt transforms xml into xhtml
.xmlhttp - primary communication broker
.javascript script language used to be program an ajax engine.

In reality, all these technologies are available to be used in ajax solutions. but only three are requires : html/xhtml, dom and javascript. xhtml is obviously necessary for the display of information, while the dom is necessary to change portions of an html page without reloading it, the last part, javascript. is necessary to initiate the client server communication and manipulate the dom to update other technologies in the list are helpful in fine turning an ajax solution, but thet aren’t necessary.

原创粉丝点击