ajax comet

There are a number of ways to implement Ajax and Comet, and these underlying implementations
are sometimes known as transports.

有很多方法可以实现ajax和comet,这些底层实现有时叫做transports.

 

The <img> element, for example,
has a src property. When a script sets this property to a URL, an HTTP GET request
is initiated to download an image from that URL.

例如,<img>元素有一个src属性。当脚本设置它的属性为一个URL时,一个HTTP GET请求被创建,来从这个URL上下载图像。

 

A script can therefore pass information
to a web server by encoding that information into the query-string portion of the
URL of an image and setting the src property of an <img> element.

脚本可以向服务器传送信息,通过把那些信息编码成图像URL的查询字符串的一部分,和设置<img>元素的src属性。

 

The web server must
actually return some image as the result of this request, but it can be invisible: a transparent
1-pixel-by-1-pixel image, for instance.

服务器必须返回一些图像,作为这个请求的结果,但是它可以不可见:例如一张透明图片。

 

posted @ 2015-03-18 14:47  bjsunhe  阅读(129)  评论(0编辑  收藏  举报