可以使用AJAX协议不是HTTP或HTTPS等? [英] Can AJAX use protocols other than HTTP or HTTPS?

查看:276
本文介绍了可以使用AJAX协议不是HTTP或HTTPS等?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道AJAX可以用比其他的协议HTTP或HTTPS。

I wonder if AJAX can use protocols other than HTTP or HTTPS.

推荐答案

阿贾克斯意味着 XMLHtt prequest 。正如你不必使用XML XHR,你也不必使用HTTP。

Ajax means XMLHttpRequest. Just as you don't have to use XML with XHR, you also don't have to use HTTP.

尽管它的名字, XMLHtt prequest 可用于获取任何类型的数据,而不仅仅是XML的,它支持的协议比HTTP等(包括文件 FTP )。

Despite its name, XMLHttpRequest can be used to retrieve any type of data, not just XML, and it supports protocols other than HTTP (including file and ftp).

W3C XMLHtt prequest规范(强调):

的XMLHtt prequest对象实现由脚本引擎,允许脚本来执行HTTP客户端功能,如从一个服务器提交表格数据或加载数据暴露的接口。它是ECMAScript的HTTP API。

The XMLHttpRequest object implements an interface exposed by a scripting engine that allows scripts to perform HTTP client functionality, such as submitting form data or loading data from a server. It is the ECMAScript HTTP API.

的对象的名称是XMLHtt prequest用于与Web兼容性,尽管这种名称的每个组分是可能产生误导。首先,该对象支持任何基于文本的格式,包括XML。其次,它可以被用来做了HTTP和HTTPS请求(一些实现支持的协议,除了HTTP和HTTPS,但功能不属于本规范)。最后,它支持在因为它涉及到的HTTP一词是广义​​的请求;即所有活动参与的HTTP请求或响应的定义HTTP方法。

The name of the object is XMLHttpRequest for compatibility with the Web, though each component of this name is potentially misleading. First, the object supports any text based format, including XML. Second, it can be used to make requests over both HTTP and HTTPS (some implementations support protocols in addition to HTTP and HTTPS, but that functionality is not covered by this specification). Finally, it supports "requests" in a broad sense of the term as it pertains to HTTP; namely all activity involved with HTTP requests or responses for the defined HTTP methods.

超越HTTP和HTTPS可用的协议都非标准化的,所以他们依赖于 1 您使用的特定环境。也就是说,所有符合XHR实现必须支持HTTP和HTTPS,但不是的需要的支持任何其他具体协议。这意味着,你可能会发现,Internet Explorer支持

The available protocols beyond HTTP and HTTPS are non-standardized, so they depend on the specific environment1 you're using. That is, all compliant XHR implementations must support HTTP and HTTPS, but are not required to support any other specific protocols. That means that you might find that Internet Explorer supports

1 如,该版本,浏览器(Safari浏览器VS火狐浏览器VS VS <子> VS歌​​剧院VS ...),或其中服务器端执行(V8 VS犀牛VS ...)

1Such as, which version of which browser (Safari vs Firefox vs Chrome vs IE vs Opera vs...), or which server-side implementation (V8 vs Rhino vs...)

这篇关于可以使用AJAX协议不是HTTP或HTTPS等?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆