如何开始学习Ajax的? [英] How to start learning Ajax?

查看:125
本文介绍了如何开始学习Ajax的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阿贾克斯 - 异步JavaScript和XML

Ajax - Asynchronous JavaScript And XML

这是什么内容? HTML,JavaScript的,XML,jQuery的?

What does it include? HTML, JavaScript, XML, jQuery?

什么是开始学习Ajax的最佳方式是什么?我是否应该从HTML和JavaScript的基础知识开始或Base我在一个特定的语言或库指令?

What is the best way to start learning Ajax? Should I start from the basics of HTML and JavaScript or base my instruction on a particular language or library?

推荐答案

阿贾克斯,总之,从一个网页一个web服务器进行通信,使用JavaScript,而不必离开页面的过程。

Ajax is, in short, the process of communicating with a webserver from a page, using JavaScript, without leaving the page.

您需要知道这一点的关键事情是:

The key things you need to know for this are:

  • JavaScript的需要作出的请求和处理响应
  • 要接受请求并做出响应(除非你正在使用提供此为您服务)所需的服务器端code

这个服务器端很大程度上取决于你正在使用什么样的服务器端环境,所以没有什么有用的是具体的,可以这样说。有什么可以通常说的是何种形式的答复可以采取。

The server side of this depends very much on what server side environment you are working with, so there is little useful that is specific that could be said. What can be usually said are what form the responses can take.

  • JS​​ON是一种流行的用于发送结构化数据的方法。
  • XML是另一种方式来发送结构化数据,但已经失宠后期由于JSON,可以说,更易于使用。
  • HTML的大块是流行的推搡到页面与的innerHTML
  • 纯文本的微小位是简单的答复是有用的。
  • JSON is a popular approach for sending structured data.
  • XML is another way to send structured data, but has been falling out of favour of late since JSON is, arguably, easier to work with.
  • Chunks of HTML are popular for shoving into pages with innerHTML.
  • Tiny bits of plain text are useful for simple responses.

至于在客户端,有两种常见的方法

As for the client side, there are two common approaches.

  • XMLHtt prequest,这是强大的,但只限于由同源策略请求当前域。
  • JS​​ON-P,其原理是从第三方调用由第一方的一个参数调用中定义的所有数据的功能加载脚本跨域方法。

现在的一些资源:

  • The W3C provides a good guide to JavaScript and other web standards (originally organised by Opera but migrated in the last few years) if you need some background.
  • Jim Ley has a reasonable introduction to the XMLHttpRequest object
  • Ajaxian has an introduction to JSON-P
  • YUI has a module for making XHR and JSON-P requests easier, as does jQuery.

这篇关于如何开始学习Ajax的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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