编辑“WordPress:AJAX

跳转至: 导航、​ 搜索
警告:您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您登录创建一个账户,您的编辑将归属于您的用户名,且将享受其他好处。

该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。

最后版本 您的文本
第1行: 第1行:
==What is Ajax?==
== Ajax是什么?==
== Ajax是什么?==
Ajax (Asynchronous JavaScript And XML) is a technology that allows a web page to perform actions or update dynamically, without completely reloading. The idea is that by using Ajax technology, a web site can be more responsive and interactive than a non-Ajax site. For instance, without Ajax, Google Maps might require you to click a link on the left side of the map and wait for the page to reload in order to scroll the map to the left. With Ajax, you can instead simply drag the map to scroll, and while there might be a small delay, it is a much shorter delay and less disruptive process than if you had to wait for the entire page to load.
Ajax(异步JavaScript和XML)是一个技术,能够使网页动态地执行一个行动或者更新,不需要重新地载入。通过使用Ajax技术,一个网站比一个非Ajax的站点,反应更加灵敏,互动性更强。例如,没有Ajax,Google地图可能要求你点击地图左边的一个链接,并且等待网页重新载入来将地图滚至左边。拥有了Ajax之后,你可以简单地将地图拖拉到滚至左边,就可以了,但是可能会有一点耽搁时间,但是这相对与你需要等待整个网页载入而言,只是一个简短的耽搁时间,而且这个过程的破坏性也更小。
Ajax(异步JavaScript和XML)是一个技术,能够使网页动态地执行一个行动或者更新,不需要重新地载入。通过使用Ajax技术,一个网站比一个非Ajax的站点,反应更加灵敏,互动性更强。例如,没有Ajax,Google地图可能要求你点击地图左边的一个链接,并且等待网页重新载入来将地图滚至左边。拥有了Ajax之后,你可以简单地将地图拖拉到滚至左边,就可以了,但是可能会有一点耽搁时间,但是这相对与你需要等待整个网页载入而言,只是一个简短的耽搁时间,而且这个过程的破坏性也更小。
If you already know about Ajax, and want to use it in a plugin you are developing, skip to [[WordPress:AJAX in Plugins]].


如果你已经知道了关于Ajax的信息,而且想在一个你发展的插件中使用Ajax,跳到[[WordPress:AJAX in Plugins|插件中的AJAX]]。
如果你已经知道了关于Ajax的信息,而且想在一个你发展的插件中使用Ajax,跳到[[WordPress:AJAX in Plugins|插件中的AJAX]]。
==How does Ajax work?==


== Ajax是怎样运行的?==
== Ajax是怎样运行的?==
Ajax technology is actually fairly simple to describe. Basically, the web programmer connects a link, button, or some other type of user interface element on the web page to a JavaScript program. When the user activates the interface (clicks on the link, drags the mouse, etc.), the JavaScript program sends some information or a request for data to a URL on the web server. Next, a program on the web server (probably also created by the web programmer) processes the request and sends back a response or some data. Typically the data is in XML format, but that is not actually required. When the data or response arrives in the browser, the JavaScript program receives an "asynchronous" notification, so that it can be processed or displayed appropriately.


Ajax 技术事实上描述起来非常简单。一般来说,网络程序员将一个链接,按钮,或者网页上用户界面元素的其它类型,连接到JavaScript程序中。当用户激活了界面(点击链接,拖动鼠标,等等),JavaScript程序向网络服务器上的一个URL发送了一些信息或者一个数据请求。然后,网络服务器上的一个程序(可能是由网络程序员设计的)处理这个请求并且返回一个响应或者一些数据。一般来说,数据是XML格式的,但是这种格式并不是必须的。当数据或者响应到达浏览器的时候,JavaScript程序收到了一个"异步" 通知,这样,程序就可以适当地处理和显示了。
Ajax 技术事实上描述起来非常简单。一般来说,网络程序员将一个链接,按钮,或者网页上用户界面元素的其它类型,连接到JavaScript程序中。当用户激活了界面(点击链接,拖动鼠标,等等),JavaScript程序向网络服务器上的一个URL发送了一些信息或者一个数据请求。然后,网络服务器上的一个程序(可能是由网络程序员设计的)处理这个请求并且返回一个响应或者一些数据。一般来说,数据是XML格式的,但是这种格式并不是必须的。当数据或者响应到达浏览器的时候,JavaScript程序收到了一个"异步" 通知,这样,程序就可以适当地处理和显示了。


如今, Ajax被大多数可视网络浏览器支持(但是只有用户打开JavaScript才可以)。当然,与大多数复杂的JavaScript类似,浏览器执行JavaScript的方式会有所不同。 但是,这并不是很难克服的困难。Ajax上唯一的限制因素是你将信息发送到的URL必须与JavaScript来自的站点URL的在同一个站点上。除了这个以外,技术的使用只会取决你,你是否知道怎样编程。
Today, Ajax is supported in some form by most visual web browsers (though only if the user has JavaScript turned on). Of course, like most complex JavaScript, there are differences between how browsers implement JavaScript. However, these are not too difficult to overcome. The only real restriction on Ajax is that the URL you send the information to has to be on the same web site as the URL the JavaScript came from. Other than that, the uses for the technology are only limited to what you can figure out how to program.
 
如今, Ajax有大多数可视网络浏览器提供(但是只有偶用户打开JavaScript才可以)。当然,与大多数复杂的JavaScript类似,浏览器执行JavaScript的方式会有所不同。 但是,这并不是很难克服的困难。Ajax上唯一的限制因素是你将信息发送到的URL必须与JavaScript来自的站点URL的在同一个站点上。除了这个以外,技术的使用只会取决你,你是否知道怎样编程。
 
==Ajax in WordPress==


== WordPress中的Ajax==
== WordPress中的Ajax==


因为Ajax具有的响应性,Ajax技术被各种各样的网站所使用-- WordPress 也不例外。当前,WordPress的核心只会在管理界面上使用Ajax。例如,当你在审核评论或者当你在添加或者删除列表上的一些内容,如类别,友情链接,和文章的时候,Ajax就被用来立即更新;Ajax也是文章和网页编辑界面自动保存功能后的一种技术。几个主题和插件也使用Ajax;例如,一些文章给插件分级使用Ajax 来在数据库储存中访客的等级级别然后显示一个更新了的平均的等级级别。
Because of its responsiveness, Ajax technology is being adopted by all sorts of web sites -- and WordPress is no exception. Currently, the core of WordPress uses Ajax only in the administration screens. For instance, Ajax is used for instant updates when you are doing comment moderation, and when you are adding and deleting items from lists such as categories, blogroll, and posts; Ajax is also the technology behind the auto-save functionality on post and page editing screens. Several themes and plugins also use Ajax; for instance, some post rating plugins use Ajax to store the visitor's rating in the database and then display an updated average rating.
 
因为Ajax具有的响应性,Ajax技术有各种各样的网站所使用-- WordPress 也不例外。当前,WordPress的核心只会在管理界面上使用Ajax。例如,当你在审核评论或者当你在添加或者删除列表上的一些内容,如类别,友情链接,和文章的时候,Ajax就被用来立即更新;Ajax也是文章和网页编辑界面自动保存功能后的一种技术。几个主题和插件也使用Ajax;例如,一些文章给插件分级使用Ajax 来在数据库储存中访客的等级级别然后显示一个更新了的平均的等级级别。
 
==Further Reading==


==深入阅读==
==深入阅读==
=== General Information ===


===一般的信息 ===
===一般的信息 ===
* [http://en.wikipedia.org/wiki/AJAX Wikipedia Ajax article]
* [http://www.adaptivepath.com/publications/essays/archives/000385.php Adaptive Path's Ajax essay]


* [http://en.wikipedia.org/wiki/AJAX Wikipedia Ajax 文章]
* [http://en.wikipedia.org/wiki/AJAX Wikipedia Ajax 文章]
* [http://www.adaptivepath.com/publications/essays/archives/000385.php Adaptive Path的 Ajax 随笔]
* [http://www.adaptivepath.com/publications/essays/archives/000385.php Adaptive Path的 Ajax 随笔]
=== Developer Information ===


=== 开发者的信息 ===
=== 开发者的信息 ===
* [[WordPress:AJAX_in_Plugins| Codex - Ajax in Plugins]] - WordPress-specific information on how to add Ajax to plugins
* [http://www.webpasties.com/xmlHttpRequest/ Webpastie's Ajax tutorial]
* [http://sourcelabs.com/ajb/archives/2005/05/ajax_mistakes.html Alex Bosworth's Ten Common Ajax mistakes]
* [http://www.fiftyfoureleven.com/resources/programming/xmlhttprequest/examples fiftyfoureleven's Ajax Examples List]
<br />
A collection thanks to [[WordPress:User:Jalenack/Using_AJAX|User:Jalenack's "Using Ajax"]]:
* [http://www.adaptivepath.com/publications/essays/archives/000385.php Adaptive Path's Ajax essay]
* Ten [http://sourcelabs.com/ajb/archives/2005/05/ajax_mistakes.html Common Ajax mistakes]
* Webpastie's Ajax [http://www.webpasties.com/xmlHttpRequest/ tutorial]
* Ajax on the [http://en.wikipedia.org/wiki/AJAX Wikipedia]
* [http://www.fiftyfoureleven.com/resources/programming/xmlhttprequest/examples Working Examples] of Ajax
* Simplified Ajax - [http://www.modernmethod.com/sajax/ SAJAX]
* [http://openrico.org/home.page Rico] Ajax library


* [[WordPress:AJAX_in_Plugins| Codex –插件中的Ajax]] – WordPress特别的信息关于怎样将啊Ajax添加到插件上
* [[WordPress:AJAX_in_Plugins| Codex –插件中的Ajax]] – WordPress特别的信息关于怎样将啊Ajax添加到插件上
第36行: 第84行:
  * 简化的 Ajax - [http://www.modernmethod.com/sajax/ SAJAX]
  * 简化的 Ajax - [http://www.modernmethod.com/sajax/ SAJAX]
* [http://openrico.org/home.page Rico] Ajax 图书馆
* [http://openrico.org/home.page Rico] Ajax 图书馆
=== Generally Speaking ===


=== 一般而言 ===
=== 一般而言 ===
* "[http://hinchcliffe.org/archive/2007/01/20/12675.aspx Eleven Emerging Ideas for SOA Architects in 2007]" from Hinchcliffe.org; "This allows widgets, Ajax applications, and mashups to be wired together so quickly it can almost be done in real-time with the latest tools."


* "[http://hinchcliffe.org/archive/2007/01/20/12675.aspx 2007年SOA Architects是一个兴起的观点、]" 来自Hinchcliffe.org; "这个允许T widgets, Ajax 应用软件, 和mashups一起运行,速度如此之快,它用最新的工具,几乎能够实时的完成"
* "[http://hinchcliffe.org/archive/2007/01/20/12675.aspx 2007年SOA Architects是一个兴起的观点、]" 来自Hinchcliffe.org; "这个允许T widgets, Ajax 应用软件, 和mashups一起运行,速度如此之快,它用最新的工具,几乎能够实时的完成"
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅Wordpress-mediawiki:版权的细节)。 未经许可,请勿提交受版权保护的作品!
取消 编辑帮助(在新窗口中打开)