JSON XML Comparison

Same point

  • Plain Text
  • Having a "self-descriptive" (human readable)
  • It has a hierarchical structure
  • JavaScript can be resolved by
  • Data may be transmitted using AJAX

difference

  • No end tag
  • Shorter
  • Faster read and write speeds
  • It can be built using JavaScript eval () methods to parse
  • Using arrays
  • Do not use a reserved word

Why use JSON?

For applications, AJAX, JSON faster and easier to use than XML:

Use XML

  • Read XML documents
  • Use XML DOM to traverse the document circulation
  • And read the value stored in the variable

Using JSON

  • Read JSON string
  • Treated with JSON string eval ()

Guess you like

Origin www.cnblogs.com/1016391912pm/p/11886613.html