SlideShare a Scribd company logo
JSON JavaScript Object Notation   Developed by: Musavir Iftikhar Jan 2007
Introduction A lightweight data-interchange format.  Easy for humans to read and write. Alternative solution of XML  A text format that is completely language independent Uses convention like C and Java It is JavaScript based Language
JSON values A collection of name/value pairs. In various languages, this is realized as an  object , record, struct, dictionary, hash table, keyed list, or associative array An ordered list of values. In most languages, this is realized as an  array , vector, list, or sequence.
Data types in JavaScript Primitive data types are as followings Undefined Null Boolean  Number and String .   <script> int a = 5;  Alert (typeof a) // will show int </script>
Built-in Objects in JavaScript Built-in JavaScript objects  Image, array and object Following is an instance of image built-in javascript object <script> var Image1 = new Image();  Image1.src = “bird. gif &quot;; </script>
New Object in JavaScript   A function in JavaScript is an Object <script> function myFunc(){  }  var myObject = new myFunc();  alert(typeof myObject);  // displays &quot;object“ </script>
Constructor of object A constructor is the default value of function <script> function myFunc(){   return 5;  }  var myObject = myFunc();  alert(typeof myObject); // displays &quot;number“ </script>
Object function more Function with default value <script> function myFunc(){   this.StringValue = &quot;This is a String&quot;;  }  var myObject = new myFunc();  var myObject2 = new myFunc();  alert(myObject2.StringValue); // displays &quot;This is a String“ </script>
Passing values to Objects Function that takes Object’s value <script> function myFunc(StringValue){   this.StringValue = StringValue;  }  var myObject = new myFunc(&quot;This is myObject's string&quot;);  var myObject2 = new myFunc(&quot;This is a String&quot;);  alert(myObject.StringValue); // displays &quot;This is myObject's string&quot;  alert(myObject2.StringValue); // displays &quot;This is a String“ </script>
Object with methods A Object with functions is a function that uses other functions for its functionality. <script> function Circle(radius){   this.radius = radius;   this.getArea = getArea;   this.getCircumference = getCircumference;  }  function getArea(){  return (this.radius*this.radius*3.14);  }  function getCircumference(){  var diameter = this.radius*2;  var circumference = diameter*3.14;  return circumference;  }
Code.. continue  var bigCircle = new Circle(100);  var smallCircle = new Circle(2);  alert(bigCircle.getArea()); // displays 31400  alert(bigCircle.getCircumference()); // displays 618  alert(smallCircle.getArea()); // displays 12.56 alert(smallCircle.getCircumference()); // displays 12.56 </script> Note: this key world always point to the variable of that object that is instantiated. The functions that Object using refer to the variable of Object function when they Come across this keyword as this.radius means the radius of the Object function Circle.
Inner or Nested functions Inner Function is created inside the function for Objected Oriented programming style. It is clear and easy to write.  Note: the constructor function argument variable must be accessed by using key world  this <script> function Circle(radius){   this.radius = radius;   this.getArea = function(){     return (this.radius*this.radius*3.14);   }   this.getCircumference = function(){     var diameter = this.radius*2;     var circumference = diameter*3.14;     return circumference;   }  }
Code…continue var bigCircle = new Circle(100);  var smallCircle = new Circle(2);  alert(bigCircle.getArea()); // displays 31400  alert(smallCircle.getCircumference()); // displays 12.56 </script>
JSON Object object   {} {   members   }   members   pair pair   ,   members   pair   string   :   value   array   [] [   elements   ]   elements   value   value   ,   elements
JSON Object value   string number object array true false null   string   &quot;&quot; &quot;   chars   &quot;   chars   char char chars
JSON Object char   any-Unicode-character-      except- &quot; -or- \ -or-      control-character \&quot; \\ \/ \b \f \n \r \t \u   four-hex-digits   number   int int frac int exp int frac exp
JSON Object int   digit digit1-9 digits   -   digit -   digit1-9 digits   frac   .   digits   exp   e   digits   digits   digit digit   digits e   e e+ e- E E+ E-
Using JSON JSON is available for two sides Server side JSON Format is written in the server specific language as C, C++, C#, java, PHP etc.  It is used to decode the client request Client side JSON JavaScript is used to encode the JSON response to convert it into text representation of receiving Object
Server side Requirements Need JSON file written in support server side language as for PHP JSON.php Include into page and create a new instance <?php require_once &quot;JSON.php&quot;; //create a new instance of Services_JSON $json = new Services_JSON(); ?>

More Related Content

PPSX
JDBC: java DataBase connectivity
PPTX
Object Oriented Programming In JavaScript
PPT
Java Networking
PDF
Introduction to JSON
PPTX
Introduction to ajax
PPT
JQuery introduction
PPTX
Introduction to Spring Boot
JDBC: java DataBase connectivity
Object Oriented Programming In JavaScript
Java Networking
Introduction to JSON
Introduction to ajax
JQuery introduction
Introduction to Spring Boot

What's hot (20)

PDF
Java I/o streams
PPTX
jQuery PPT
PPT
Java tutorial PPT
PPT
Jdbc ppt
PDF
Oops concepts || Object Oriented Programming Concepts in Java
PDF
Javascript basics
PPTX
Java string handling
PPTX
Java Server Pages(jsp)
PPTX
Introduction to JavaScript Basics.
PDF
IT2255 Web Essentials - Unit I Website Basics
PPSX
Data Types & Variables in JAVA
PPTX
Express js
PPTX
Control Statements in Java
PPTX
Web services SOAP
PDF
Web Programming Assignment
PPTX
JSON: The Basics
PPT
Struts
PPTX
jQuery
PPTX
HTTP request and response
PDF
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
Java I/o streams
jQuery PPT
Java tutorial PPT
Jdbc ppt
Oops concepts || Object Oriented Programming Concepts in Java
Javascript basics
Java string handling
Java Server Pages(jsp)
Introduction to JavaScript Basics.
IT2255 Web Essentials - Unit I Website Basics
Data Types & Variables in JAVA
Express js
Control Statements in Java
Web services SOAP
Web Programming Assignment
JSON: The Basics
Struts
jQuery
HTTP request and response
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
Ad

Viewers also liked (7)

PPT
Php Sq Lite
PPT
Php Calling Operators
PPT
Php Sessoins N Cookies
PPT
Php Simple Xml
PPT
Php Operators N Controllers
PPTX
Rest Essentials
PPT
Php String And Regular Expressions
Php Sq Lite
Php Calling Operators
Php Sessoins N Cookies
Php Simple Xml
Php Operators N Controllers
Rest Essentials
Php String And Regular Expressions
Ad

Similar to Json (20)

PPT
JavaScript Needn't Hurt!
PPT
JavaScript Object Notation (JSON)
PPTX
OO in JavaScript
PDF
Js objects
PPT
Beginning Object-Oriented JavaScript
PPT
Ajax and JavaScript Bootcamp
PDF
JavaScript Lessons 2023 V2
PPT
J s-o-n-120219575328402-3
PPT
JavaScript Basics
PPT
Javascript2839
PPT
PPTX
Awesomeness of JavaScript…almost
PPT
eXo SEA - JavaScript Introduction Training
PPTX
Javascript Objects Deep Dive
KEY
JavaScript Neednt Hurt - JavaBin talk
PDF
Advanced JavaScript Development
PPTX
JavaScript, Beyond the Curly Braces
PPT
JavaScript - Programming Languages course
PPTX
javascript
PPTX
JavaScript OOPS Implimentation
JavaScript Needn't Hurt!
JavaScript Object Notation (JSON)
OO in JavaScript
Js objects
Beginning Object-Oriented JavaScript
Ajax and JavaScript Bootcamp
JavaScript Lessons 2023 V2
J s-o-n-120219575328402-3
JavaScript Basics
Javascript2839
Awesomeness of JavaScript…almost
eXo SEA - JavaScript Introduction Training
Javascript Objects Deep Dive
JavaScript Neednt Hurt - JavaBin talk
Advanced JavaScript Development
JavaScript, Beyond the Curly Braces
JavaScript - Programming Languages course
javascript
JavaScript OOPS Implimentation

More from mussawir20 (20)

PPT
Database Design Process
PPT
Php Rss
PPT
Php Reusing Code And Writing Functions
PPT
Php Oop
PPT
Php My Sql
PPT
Php File Operations
PPT
Php Error Handling
PPT
Php Crash Course
PPT
Php Basic Security
PPT
Php Using Arrays
PPT
Javascript Oop
PPT
PPT
Javascript
PPT
Object Range
PPT
Prototype Utility Methods(1)
PPT
PPT
Prototype js
PPT
Template
PPT
Class
PPT
Element
Database Design Process
Php Rss
Php Reusing Code And Writing Functions
Php Oop
Php My Sql
Php File Operations
Php Error Handling
Php Crash Course
Php Basic Security
Php Using Arrays
Javascript Oop
Javascript
Object Range
Prototype Utility Methods(1)
Prototype js
Template
Class
Element

Recently uploaded (20)

PDF
Reimagining Insurance: Connected Data for Confident Decisions.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PDF
Modernizing your data center with Dell and AMD
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPTX
CroxyProxy Instagram Access id login.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Sensors and Actuators in IoT Systems using pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
Newfamily of error-correcting codes based on genetic algorithms
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Reimagining Insurance: Connected Data for Confident Decisions.pdf
NewMind AI Weekly Chronicles - August'25 Week I
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
“AI and Expert System Decision Support & Business Intelligence Systems”
Smarter Business Operations Powered by IoT Remote Monitoring
Modernizing your data center with Dell and AMD
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
Chapter 3 Spatial Domain Image Processing.pdf
Advanced Soft Computing BINUS July 2025.pdf
CroxyProxy Instagram Access id login.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Sensors and Actuators in IoT Systems using pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Newfamily of error-correcting codes based on genetic algorithms
madgavkar20181017ppt McKinsey Presentation.pdf
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
Telecom Fraud Prevention Guide | Hyperlink InfoSystem

Json

  • 1. JSON JavaScript Object Notation Developed by: Musavir Iftikhar Jan 2007
  • 2. Introduction A lightweight data-interchange format. Easy for humans to read and write. Alternative solution of XML A text format that is completely language independent Uses convention like C and Java It is JavaScript based Language
  • 3. JSON values A collection of name/value pairs. In various languages, this is realized as an object , record, struct, dictionary, hash table, keyed list, or associative array An ordered list of values. In most languages, this is realized as an array , vector, list, or sequence.
  • 4. Data types in JavaScript Primitive data types are as followings Undefined Null Boolean Number and String . <script> int a = 5; Alert (typeof a) // will show int </script>
  • 5. Built-in Objects in JavaScript Built-in JavaScript objects Image, array and object Following is an instance of image built-in javascript object <script> var Image1 = new Image(); Image1.src = “bird. gif &quot;; </script>
  • 6. New Object in JavaScript A function in JavaScript is an Object <script> function myFunc(){ } var myObject = new myFunc(); alert(typeof myObject);  // displays &quot;object“ </script>
  • 7. Constructor of object A constructor is the default value of function <script> function myFunc(){  return 5; } var myObject = myFunc(); alert(typeof myObject); // displays &quot;number“ </script>
  • 8. Object function more Function with default value <script> function myFunc(){  this.StringValue = &quot;This is a String&quot;; } var myObject = new myFunc(); var myObject2 = new myFunc(); alert(myObject2.StringValue); // displays &quot;This is a String“ </script>
  • 9. Passing values to Objects Function that takes Object’s value <script> function myFunc(StringValue){  this.StringValue = StringValue; } var myObject = new myFunc(&quot;This is myObject's string&quot;); var myObject2 = new myFunc(&quot;This is a String&quot;); alert(myObject.StringValue); // displays &quot;This is myObject's string&quot; alert(myObject2.StringValue); // displays &quot;This is a String“ </script>
  • 10. Object with methods A Object with functions is a function that uses other functions for its functionality. <script> function Circle(radius){  this.radius = radius;  this.getArea = getArea;  this.getCircumference = getCircumference; } function getArea(){ return (this.radius*this.radius*3.14); } function getCircumference(){ var diameter = this.radius*2; var circumference = diameter*3.14; return circumference; }
  • 11. Code.. continue var bigCircle = new Circle(100); var smallCircle = new Circle(2); alert(bigCircle.getArea()); // displays 31400 alert(bigCircle.getCircumference()); // displays 618 alert(smallCircle.getArea()); // displays 12.56 alert(smallCircle.getCircumference()); // displays 12.56 </script> Note: this key world always point to the variable of that object that is instantiated. The functions that Object using refer to the variable of Object function when they Come across this keyword as this.radius means the radius of the Object function Circle.
  • 12. Inner or Nested functions Inner Function is created inside the function for Objected Oriented programming style. It is clear and easy to write. Note: the constructor function argument variable must be accessed by using key world this <script> function Circle(radius){  this.radius = radius;  this.getArea = function(){    return (this.radius*this.radius*3.14);  }  this.getCircumference = function(){    var diameter = this.radius*2;    var circumference = diameter*3.14;    return circumference;  } }
  • 13. Code…continue var bigCircle = new Circle(100); var smallCircle = new Circle(2); alert(bigCircle.getArea()); // displays 31400 alert(smallCircle.getCircumference()); // displays 12.56 </script>
  • 14. JSON Object object {} { members } members pair pair , members pair string : value array [] [ elements ] elements value value , elements
  • 15. JSON Object value string number object array true false null string &quot;&quot; &quot; chars &quot; chars char char chars
  • 16. JSON Object char any-Unicode-character-      except- &quot; -or- \ -or-      control-character \&quot; \\ \/ \b \f \n \r \t \u four-hex-digits number int int frac int exp int frac exp
  • 17. JSON Object int digit digit1-9 digits - digit - digit1-9 digits frac . digits exp e digits digits digit digit digits e e e+ e- E E+ E-
  • 18. Using JSON JSON is available for two sides Server side JSON Format is written in the server specific language as C, C++, C#, java, PHP etc. It is used to decode the client request Client side JSON JavaScript is used to encode the JSON response to convert it into text representation of receiving Object
  • 19. Server side Requirements Need JSON file written in support server side language as for PHP JSON.php Include into page and create a new instance <?php require_once &quot;JSON.php&quot;; //create a new instance of Services_JSON $json = new Services_JSON(); ?>