The xmlHttpRequest component is used as the interaction tool and XML as the data transmission format.
[XML]
Advantages of using XML as the transmission format:
1. unified format, compliant with standards
2. Easy remote interaction with other systems and convenient data sharing
Disadvantages:
1. XML file format is large, complex, and occupies bandwidth for Transmission
2. Both the server and client require a large amount of code to parse XML, regardless of the complexity and difficulty of maintaining the server and client code.
3. The method for parsing XML between different browsers on the client is inconsistent. You need to repeat a lot of code.
4. It takes resources and time for the server and client to parse XML
[JSON]
In addition to the XML format, there are no other formats. There is a lightweight data exchange format called JSON (JavaScript Object Notation) that can replace XML.
Advantages:
1. The data format is relatively simple, easy to read and write, the format is compressed, and the bandwidth usage is small
2. It is easy to parse this language. The client JavaScript can simply read JSON data through eval ().
3. Supports multiple languages, including ActionScript, C, C #, ColdFusion, Java, JavaScript, Perl, PHP, Python, Ruby, and other language server-side languages for server-side Parsing
4. in the PHP world, there has been a PHP-JSON and a JSON-PHP that facilitates PHP Serialized programs to call directly. PHP server objects and arrays can directly generate JSON format to facilitate client access extraction.
In addition, the PEAR class of PHP has proposed support (http://pear.php.net/pepr/pepr-proposal-show.php? Id = 198)
5. JSON format can be used directly for server-side code, which greatly simplifies the development of server-side and client-side code, but the completed tasks remain unchanged and easy to maintain.
Disadvantages:
1. It is widely used and widely used without the XML format. It is not as universal as XML.
2. The JSON format is still in the initial stage in Web Service promotion.
PS: It is said that Google's Ajax is made using the JSON + template.