There are a number of ways to implement Ajax and Comet, and these underlying implementations
are sometimes known as transports.web
有不少方法能夠實現ajax和comet,這些底層實現有時叫作transports.ajax
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上下載圖像。this
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屬性。spa
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.orm
服務器必須返回一些圖像,做爲這個請求的結果,可是它能夠不可見:例如一張透明圖片。server