• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » What is JSON and How it Works?

By Abhishek Ghosh May 9, 2014 6:18 am Updated on May 9, 2014

What is JSON and How it Works?

Advertisement

We often hear about JSON. But what is this JSON and How it works? JSON stands for JavaScript Object Notation, it is a lightweight format for data exchange. JSON is a subset of the object literal notation of JavaScript that does not require the use of XML. The simplicity of JSON has led to their widespread use, especially as an alternative to XML in AJAX. One of the supposed advantages of JSON over XML as a data exchange format in this context is that it is much easier to write a parser (parser) in JSON.

 

JSON : Data Types, Syntax and Example

 

In JavaScript, a JSON text can be analyzed using the function eval (), which is fundamental to JSON has been accepted by the AJAX developer community, due to the ubiquity of JavaScript in almost any web browser. In practice, the case for ease of development of analyzers or performance thereof are irrelevant because of the safety issues posed by the use of eval() and the rise of native XML processing incorporated in the modern browsers.

For that reason, JSON is typically used in environments where the size of the data flow between client and server is vital (hence its use by Yahoo, Google, etc., serving millions of users) when the data source is explicitly trusted and is not important where the XSLT processing does not have to manipulate the data on the client. While it is common to see JSON positioned against XML, is also frequent use of JSON and XML in the same application. For example, a client application that integrates data from Google Maps with weather data in SOAP necessitate support both formats.

Advertisement

---

There is growing support JSON using packages written by third parties. The list of supported languages ??includes ActionScript , C , C + + , C # , ColdFusion , Common Lisp , Delphi , E , Eiffel , Java , JavaScript , ML , Objective-C , Objective CAML , Perl , PHP , Python , Rebol , Ruby , Lua and Visual FoxPro. In December 2005, Yahoo! began to optional JSON support in some of their web services. The term JSON is highly publicized in the media programming, however, is a term described as evil is actually only part of the definition of the ECMA-262 standard which is based on Javascript. Hence, neither Yahoo nor Google use JSON, but LJS. One of the intrinsic qualities of Javascript called LJS (Literal Javascript) facilitates the flow of data or functions for which does not require the function eval() if the data are transferred as in the case of XML – Everything about data transfer all types, including arrays, booleans, integers, etc. never not require the function eval().

What is JSON and How it Works

The data can be nested, for example, an array of objects is possible. Encoding of JSON is by default UTF-8. Also, UTF-16 and UTF-32 are compatible. JSON recognizes the following data types:
Zero value : is null
Boolean value : is determined by the keywords true and false. These are not character strings. They are therefore not enclosed in quotes.
Number : is a sequence of digits 0 – 9. This sequence can by leaded by a negative sign.
String : begins and ends with double straight quotation marks ( ” )
Array : starts with [ and ends with ] . It contains an ordered list of values, divided by commas, of same or different type. Empty arrays are allowed.
Object : begins with { and ends with }. It contains unordered list of properties, divided by commas. Objects without properties (“empty objects”) are permitted.
Property : consists of a key and a value, separated by a colon ( Name:Abhishek ). The keys of all the properties in an object must be unique and different in pairs. The key is a string . The value is an object, an array, a string, a number or one of the expressions true , false or null .

 

Using JSON

 

In theory, it is trivial to parse JSON in JavaScript using the function eval() built-in language. For example:

Vim
1
myObject = eval ('(' + json_datos + ')');

In practice, security considerations usually do not recommend using eval on raw data and should be a separate JavaScript to ensure safety. The analyzer provided by JSON.org use eval() function in its analysis, protecting it with a regular expression so that the function only looks unsafe expressions. An example of JSON data access using XMLHttpRequest is:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
http_request var = new XMLHttpRequest ();
var url = "https://thecustomizewindows.com/xmlprc.php" // This URL should return JSON data
// Download the JSON data from the server.
http_request onreadystatechange = handle_json.;
http_request open ("GET", url, true).;
http_request send (null).;
handle_json function () {
   if (readyState http_request. == 4) {
     if (status == http_request. 200) {
       json_data var responseText = http_request.;
       the_object var = eval ("(" + json_data + ")");
     Else {}
       alert ("There was a problem with the URL.");
     }
     http_request = null;
   }
}

Note that the use of XMLHttpRequest in this example is not compatible with all browsers, because there are syntactic variations for Internet Explorer, Opera, Safari and browsers based on Mozilla.

Tagged With how json works , why json , how jason works , what is json object
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to What is JSON and How it Works?

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • JSON-LD in Details

    JSON-LD (JSON for Linked data) refers to the recommendation of the W3C, embedded linked data in the lightweight JSON Format. Here is details.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy