• 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

This Article Has Been Shared 873 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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?

  • Windows Like Linux Distro Zorin OS : Another Linux Distro

    Windows Like Linux distro is most often searched by Power users to switch from Windows OS to Linux OS. Zorin OS is a Powerful Linux distro with Windows look.

  • Settings For Perfect Sound on MacBook Pro 15″ With Video

    Settings For Perfect Sound on MacBook Pro 15″ – this time not only text and screenshots but with video and real time sound with one music which is well known.

  • Keyless Door Unlocking Mobile Cloud Based Apps : Gaining More Interest

    Keyless Door Unlocking Mobile Cloud Based Apps like Lockitron, ShareKey are growing interest from both the developers and the users. Let us have a deeper look.

  • Chromatic Aberration in Digital Photography

    Chromatic Aberration in Photography is an aberration of optical lenses, resulting from incident light of various wavelengths refracted at different rates.

  • Commands For Mac : Learning the Command Line Interface

    Commands For Mac are one of the most useful and powerful point as for an Operating system.Not all users are used with UNIX CLI,so here is an easy guide for you.

Additionally, 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (21K Followers)
  • Twitter (5.3k 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

  • Why Not to Use Your Host for Email Marketing March 5, 2021
  • What You Need to Know About the Microservices March 4, 2021
  • Fix Missing/Bad FileProvider for Freshchat (Android error code 354) March 3, 2021
  • Basics of Data Protection on the Internet March 2, 2021
  • What is Standard Software February 28, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "What is JSON and How it Works?," in The Customize Windows, May 9, 2014, March 6, 2021, https://thecustomizewindows.com/2014/05/what-is-json-and-how-it-works/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

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

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