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 side and the client side require a large amount of moneyCodeXML parsing, regardless of the exception, complexity, and difficulty in 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 serialization afterProgramDirectly calling objects and arrays on the. php server can directly generate JSON format, which facilitates 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.