• 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 804 Times!

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?

  • 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

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

  • Exploring the Benefits and Advantages of Microsoft’s Operating System March 22, 2023
  • Web Design Cookbook: Accessibility March 21, 2023
  • Online Dating: How to Find Your Match March 20, 2023
  • Web Design Cookbook: Logo March 19, 2023
  • How Starlink Internet Works March 17, 2023

About This Article

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

Source:The Customize Windows, JiMA.in

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT