SlideShare a Scribd company logo
Ayes Chinmay
Internet
&
Web Technology
(jQuery & JSON)
IWT Syllabus:
Module 3:
XML
Introduction to XML, XML vs HTML, Structures of a XML Document, Document Type Declaration (DTD),
XML Validation, Well Formed XML Documents, Valid XML Document, XML DOM, XSL, XSL ransformation,
XML Namespaces, XML Schema.
AJAX
AJAX Introduction, AJAX - The XMLHttpRequest Object, AJAX - Server Response, Ajax XML,
Ajax Database
jQuery
jQuery DOM Selectors, HTML Content, jQuery CSS Styles, jQuery HTML DOM
JSON
Introduction, syntax, Data Types, Parsing, Stringify, Object, Arrays
React.js
Introduction, ES6, Render HTML, JSX, Components , props, state, Lifecycle, Events, forms,
CSS
jQuery:
 jQuery is a small and lightweight JavaScript library.
 jQuery is cross-platform.
 jQuery means "write less do more".
 jQuery simplifies AJAX call and DOM manipulation.
jQuery HTML:
<!DOCTYPE html>
<html>
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.1
1.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").html("Hello <b>Javatpoint.com</b>");
});
});
</script>
</head>
<body>
<button>Click here to change the
content of all p elements</button>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
jQuery CSS:
<!DOCTYPE html>
<html>
<head>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery
/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").css({"background-color": "yellow",
"font-size": "100%"});
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p style="background-color:#ff0000">The
background-color of this paragraph is red.</p>
<p style="background-color:#00ff00">The
background-color of this paragraph is green.</p>
<p style="background-color:#0000ff">The
background-color of this paragraph is blue.</p>
<p>This paragraph has no background-color.</p>
<button>Click here to set multiple styles for all
selected elements.</button>
</body>
</html>
jQuery DOM:
<html>
<head>
<title>The jQuery Example</title>
<script type = "text/javascript" src =
"https://ajax.googleapis.com/ajax/libs/jquery/2.1.3
/jquery.min.js"> </script>
<script type = "text/javascript" language
= "javascript">
$(document).ready(function() {
$("div").click(function () {
$(this).before('<div class="div"></div>' );
}); });
</script>
<style>
.div{ margin:10px;padding:12px;
border:2px solid #666; width:60px;}
</style>
</head>
<body>
<p>Click on any square below:</p>
<span id = "result"> </span>
<div class = "div" style = "background-
color:blue;"></div>
<div class = "div" style = "background-
color:green;"></div>
<div class = "div" style = "background-
color:red;"></div>
</body>
</html>
jQuery Animate:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("div").animate({
height: 'toggle'
});
});
});
</script>
</head>
<body>
<button>Start Animation</button>
<div style="background:#98bf21;height:50%;width:50%;position:absolute;"></div>
</body>
</html>
JSON:
 JSON: JavaScript Object Notation.
 JSON is a syntax for storing and exchanging data.
 JSON is text, written with JavaScript object notation.
 JSON is a lightweight data-interchange format
 JSON is "self-describing" and easy to understand
JSON Syntax:
<!DOCTYPE html>
<html>
<body>
<h2>Create Object from JSON String</h2>
<p id="demo"></p>
<script>
var txt = '{"name":"John", "age":30, "city":"New York"}'
var obj = JSON.parse(txt);
document.getElementById("demo").innerHTML = obj.name + ", " + obj.age;
</script>
</body>
</html>
JSON vs XML:
{"employees":[
{ "firstName":"John", "lastName":"Doe" },
{ "firstName":"Anna", "lastName":"Smith" },
{ "firstName":"Peter", "lastName":"Jones" }
]}
<employees>
<employee>
<firstName>John</firstName>
<lastName>Doe</lastName>
</employee>
<employee>
<firstName>Anna</firstName>
<lastName>Smith</lastName>
</employee>
<employee>
<firstName>Peter</firstName>
<lastName>Jones</lastName>
</employee>
</employees>
 Both JSON and XML are "self describing"
(human readable).
 Both JSON and XML are hierarchical (values
within values).
 Both JSON and XML can be parsed and used by
lots of programming languages.
 Both JSON and XML can be fetched with an
XMLHttpRequest.
 JSON doesn't use end tag
 JSON is shorter
 JSON is quicker to read and
write
 JSON can use arrays
JSON vs XML
JSON is Like XML
JSON.stringify():
 A common use of JSON is to exchange data to/from a web
server.
 When sending data to a web server, the data has to be a
string.
 Convert a JavaScript object into a string with JSON.stringify()
<!DOCTYPE html>
<html>
<body>
<h2>Create JSON string from a JavaScript object.</h2>
<p id="demo"></p>
<script>
var obj = { name: "John", age: 30, city: "New York" };
var myJSON = JSON.stringify(obj);
document.getElementById("demo").innerHTML = myJSON;
</script>
</body>
</html>
JSON Array:
<!DOCTYPE html>
<html>
<body>
<p>Looping through an array using a for in loop:</p>
<p id="demo"></p>
<script>
var myObj, i, x = "";
myObj = {
"name":"John",
"age":30,
"cars":[ "Ford", "BMW", "Fiat" ]
};
for (i in myObj.cars) {
x += myObj.cars[i] + "<br>";
}
document.getElementById("demo").innerHTML = x;
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<p>Access an array value of a JSON object.</p>
<p id="demo"></p>
<script>
var myObj, x;
myObj = {
"name":"John",
"age":30,
"cars":[ "Ford", "BMW", "Fiat" ]
};
x = myObj.cars[0];
document.getElementById("demo").innerHTML = x;
</script>
</body>
</html>
Model Questions:
1. How do you round the number 7.25, to the nearest
integer?
(a) Math.round(7.25) (b) Math.rnd(7.25)
(c) Math.rnd(7.25) (d) round(7.25)
2. How do you find the number with the highest value of
x and y?
(a) top(x, y) (b) ceil(x, y)
(c) Math.ceil(x, y) (d) Math.max(x, y)
Model Questions: (Cont.)
3. Is JavaScript case-sensitive?
(a) True
(b) False
4. Which symbol is used in the beginning of jQuery code ?
(a) ? (b) @
(c) $ (d) *
5. The correct syntax for a conditional statement to execute following
code if “x” is NOT equal to 8?
(a) if x =! 8 then (b) if (x<> 8)
(c) if x<>8 then (d) if (x != 8)
Next Class:
React.js

More Related Content

What's hot (20)

PPTX
Internet and Web Technology (CLASS-4) [CSS & JS]
Ayes Chinmay
 
PPT
Document Object Model
yht4ever
 
PPT
Document Object Model
chomas kandar
 
PPT
introduction to the document object model- Dom chapter5
FLYMAN TECHNOLOGY LIMITED
 
PDF
Unit 4(it workshop)
Dr.Lokesh Gagnani
 
PPT
JavaScript & Dom Manipulation
Mohammed Arif
 
PPT
JavaScript: Ajax & DOM Manipulation
borkweb
 
PPT
JavaScript
Doncho Minkov
 
PPTX
Java Script
Dr. SURBHI SAROHA
 
PDF
Javascript, DOM, browsers and frameworks basics
Net7
 
PPT
Javascript: Ajax & DOM Manipulation v1.2
borkweb
 
PPT
KMUTNB - Internet Programming 4/7
phuphax
 
PDF
Intro to Javascript and jQuery
Shawn Calvert
 
PPTX
FYBSC IT Web Programming Unit III Document Object
Arti Parab Academics
 
PDF
Intro to jQuery
Shawn Calvert
 
PPTX
Java script Advance
Jaya Kumari
 
PPTX
Part 7
NOHA AW
 
PPTX
Xml part 6
NOHA AW
 
PPTX
Introduction towebmatrix
Pranav Ainavolu
 
Internet and Web Technology (CLASS-4) [CSS & JS]
Ayes Chinmay
 
Document Object Model
yht4ever
 
Document Object Model
chomas kandar
 
introduction to the document object model- Dom chapter5
FLYMAN TECHNOLOGY LIMITED
 
Unit 4(it workshop)
Dr.Lokesh Gagnani
 
JavaScript & Dom Manipulation
Mohammed Arif
 
JavaScript: Ajax & DOM Manipulation
borkweb
 
JavaScript
Doncho Minkov
 
Java Script
Dr. SURBHI SAROHA
 
Javascript, DOM, browsers and frameworks basics
Net7
 
Javascript: Ajax & DOM Manipulation v1.2
borkweb
 
KMUTNB - Internet Programming 4/7
phuphax
 
Intro to Javascript and jQuery
Shawn Calvert
 
FYBSC IT Web Programming Unit III Document Object
Arti Parab Academics
 
Intro to jQuery
Shawn Calvert
 
Java script Advance
Jaya Kumari
 
Part 7
NOHA AW
 
Xml part 6
NOHA AW
 
Introduction towebmatrix
Pranav Ainavolu
 

Similar to Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Technology (20)

PPTX
JSON(JavaScript Object Notation)
Raghu nath
 
PPTX
JSON
Yoga Raja
 
PPTX
JSON & AJAX.pptx
dyumna2
 
KEY
Week 4 - jQuery + Ajax
baygross
 
PPT
Jquery presentation
Narendra Dabhi
 
KEY
$.Template
Dave Furfero
 
PPTX
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
Syed Moosa Kaleem
 
PDF
JavaScript: DOM and jQuery
維佋 唐
 
PPT
J query b_dotnet_ug_meet_12_may_2012
ghnash
 
PPTX
Jquery fundamentals
Salvatore Fazio
 
PPTX
UNIT 1 (7).pptx
DrDhivyaaCRAssistant
 
PPT
jQuery with javascript training by Technnovation Labs
Prasad Shende
 
PDF
Intro to JavaScript
Jussi Pohjolainen
 
PPT
jQuery introduction
Tomi Juhola
 
PDF
jQuery for beginners
Siva Arunachalam
 
PPTX
BITM3730Week8.pptx
MattMarino13
 
PPTX
Introduction to JSON & AJAX
Raveendra R
 
PPTX
Web Development Introduction to jQuery
Laurence Svekis ✔
 
PDF
AJS UNIT-1 2021-converted.pdf
SreeVani74
 
JSON(JavaScript Object Notation)
Raghu nath
 
JSON
Yoga Raja
 
JSON & AJAX.pptx
dyumna2
 
Week 4 - jQuery + Ajax
baygross
 
Jquery presentation
Narendra Dabhi
 
$.Template
Dave Furfero
 
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
Syed Moosa Kaleem
 
JavaScript: DOM and jQuery
維佋 唐
 
J query b_dotnet_ug_meet_12_may_2012
ghnash
 
Jquery fundamentals
Salvatore Fazio
 
UNIT 1 (7).pptx
DrDhivyaaCRAssistant
 
jQuery with javascript training by Technnovation Labs
Prasad Shende
 
Intro to JavaScript
Jussi Pohjolainen
 
jQuery introduction
Tomi Juhola
 
jQuery for beginners
Siva Arunachalam
 
BITM3730Week8.pptx
MattMarino13
 
Introduction to JSON & AJAX
Raveendra R
 
Web Development Introduction to jQuery
Laurence Svekis ✔
 
AJS UNIT-1 2021-converted.pdf
SreeVani74
 
Ad

More from Ayes Chinmay (8)

PPTX
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Ayes Chinmay
 
PPTX
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Ayes Chinmay
 
PPTX
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
PPTX
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
PPTX
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Ayes Chinmay
 
PPTX
Internet and Web Technology (CLASS-3) [HTML & CSS]
Ayes Chinmay
 
PPTX
Internet and Web Technology (CLASS-2) [HTTP & HTML]
Ayes Chinmay
 
PPTX
Internet and Web Technology (CLASS-1) [Introduction]
Ayes Chinmay
 
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Ayes Chinmay
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Ayes Chinmay
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Internet and Web Technology (CLASS-3) [HTML & CSS]
Ayes Chinmay
 
Internet and Web Technology (CLASS-2) [HTTP & HTML]
Ayes Chinmay
 
Internet and Web Technology (CLASS-1) [Introduction]
Ayes Chinmay
 
Ad

Recently uploaded (20)

PDF
Lean IP - Lecture by Dr Oliver Baldus at the MIPLM 2025
MIPLM
 
PPTX
AIMA UCSC-SV Leadership_in_the_AI_era 20250628 v16.pptx
home
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PPTX
infertility, types,causes, impact, and management
Ritu480198
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
Lesson 1 - Nature of Inquiry and Research.pdf
marvinnbustamante1
 
PPTX
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
PPTX
Lesson 1 Cell (Structures, Functions, and Theory).pptx
marvinnbustamante1
 
PPTX
Ward Management: Patient Care, Personnel, Equipment, and Environment.pptx
PRADEEP ABOTHU
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PPTX
Marketing Management PPT Unit 1 and Unit 2.pptx
Sri Ramakrishna College of Arts and science
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
Lean IP - Lecture by Dr Oliver Baldus at the MIPLM 2025
MIPLM
 
AIMA UCSC-SV Leadership_in_the_AI_era 20250628 v16.pptx
home
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PLANNING FOR EMERGENCY AND DISASTER MANAGEMENT ppt.pptx
PRADEEP ABOTHU
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
infertility, types,causes, impact, and management
Ritu480198
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Lesson 1 - Nature of Inquiry and Research.pdf
marvinnbustamante1
 
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
Lesson 1 Cell (Structures, Functions, and Theory).pptx
marvinnbustamante1
 
Ward Management: Patient Care, Personnel, Equipment, and Environment.pptx
PRADEEP ABOTHU
 
Horarios de distribución de agua en julio
pegazohn1978
 
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
Marketing Management PPT Unit 1 and Unit 2.pptx
Sri Ramakrishna College of Arts and science
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Controller Request and Response in Odoo18
Celine George
 

Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Technology

  • 2. IWT Syllabus: Module 3: XML Introduction to XML, XML vs HTML, Structures of a XML Document, Document Type Declaration (DTD), XML Validation, Well Formed XML Documents, Valid XML Document, XML DOM, XSL, XSL ransformation, XML Namespaces, XML Schema. AJAX AJAX Introduction, AJAX - The XMLHttpRequest Object, AJAX - Server Response, Ajax XML, Ajax Database jQuery jQuery DOM Selectors, HTML Content, jQuery CSS Styles, jQuery HTML DOM JSON Introduction, syntax, Data Types, Parsing, Stringify, Object, Arrays React.js Introduction, ES6, Render HTML, JSX, Components , props, state, Lifecycle, Events, forms, CSS
  • 3. jQuery:  jQuery is a small and lightweight JavaScript library.  jQuery is cross-platform.  jQuery means "write less do more".  jQuery simplifies AJAX call and DOM manipulation.
  • 4. jQuery HTML: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.1 1.3/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").html("Hello <b>Javatpoint.com</b>"); }); }); </script> </head> <body> <button>Click here to change the content of all p elements</button> <p>This is a paragraph.</p> <p>This is another paragraph.</p> </body> </html>
  • 5. jQuery CSS: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery /1.11.3/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").css({"background-color": "yellow", "font-size": "100%"}); }); }); </script> </head> <body> <h2>This is a heading</h2> <p style="background-color:#ff0000">The background-color of this paragraph is red.</p> <p style="background-color:#00ff00">The background-color of this paragraph is green.</p> <p style="background-color:#0000ff">The background-color of this paragraph is blue.</p> <p>This paragraph has no background-color.</p> <button>Click here to set multiple styles for all selected elements.</button> </body> </html>
  • 6. jQuery DOM: <html> <head> <title>The jQuery Example</title> <script type = "text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3 /jquery.min.js"> </script> <script type = "text/javascript" language = "javascript"> $(document).ready(function() { $("div").click(function () { $(this).before('<div class="div"></div>' ); }); }); </script> <style> .div{ margin:10px;padding:12px; border:2px solid #666; width:60px;} </style> </head> <body> <p>Click on any square below:</p> <span id = "result"> </span> <div class = "div" style = "background- color:blue;"></div> <div class = "div" style = "background- color:green;"></div> <div class = "div" style = "background- color:red;"></div> </body> </html>
  • 7. jQuery Animate: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("div").animate({ height: 'toggle' }); }); }); </script> </head> <body> <button>Start Animation</button> <div style="background:#98bf21;height:50%;width:50%;position:absolute;"></div> </body> </html>
  • 8. JSON:  JSON: JavaScript Object Notation.  JSON is a syntax for storing and exchanging data.  JSON is text, written with JavaScript object notation.  JSON is a lightweight data-interchange format  JSON is "self-describing" and easy to understand
  • 9. JSON Syntax: <!DOCTYPE html> <html> <body> <h2>Create Object from JSON String</h2> <p id="demo"></p> <script> var txt = '{"name":"John", "age":30, "city":"New York"}' var obj = JSON.parse(txt); document.getElementById("demo").innerHTML = obj.name + ", " + obj.age; </script> </body> </html>
  • 10. JSON vs XML: {"employees":[ { "firstName":"John", "lastName":"Doe" }, { "firstName":"Anna", "lastName":"Smith" }, { "firstName":"Peter", "lastName":"Jones" } ]} <employees> <employee> <firstName>John</firstName> <lastName>Doe</lastName> </employee> <employee> <firstName>Anna</firstName> <lastName>Smith</lastName> </employee> <employee> <firstName>Peter</firstName> <lastName>Jones</lastName> </employee> </employees>  Both JSON and XML are "self describing" (human readable).  Both JSON and XML are hierarchical (values within values).  Both JSON and XML can be parsed and used by lots of programming languages.  Both JSON and XML can be fetched with an XMLHttpRequest.  JSON doesn't use end tag  JSON is shorter  JSON is quicker to read and write  JSON can use arrays JSON vs XML JSON is Like XML
  • 11. JSON.stringify():  A common use of JSON is to exchange data to/from a web server.  When sending data to a web server, the data has to be a string.  Convert a JavaScript object into a string with JSON.stringify() <!DOCTYPE html> <html> <body> <h2>Create JSON string from a JavaScript object.</h2> <p id="demo"></p> <script> var obj = { name: "John", age: 30, city: "New York" }; var myJSON = JSON.stringify(obj); document.getElementById("demo").innerHTML = myJSON; </script> </body> </html>
  • 12. JSON Array: <!DOCTYPE html> <html> <body> <p>Looping through an array using a for in loop:</p> <p id="demo"></p> <script> var myObj, i, x = ""; myObj = { "name":"John", "age":30, "cars":[ "Ford", "BMW", "Fiat" ] }; for (i in myObj.cars) { x += myObj.cars[i] + "<br>"; } document.getElementById("demo").innerHTML = x; </script> </body> </html> <!DOCTYPE html> <html> <body> <p>Access an array value of a JSON object.</p> <p id="demo"></p> <script> var myObj, x; myObj = { "name":"John", "age":30, "cars":[ "Ford", "BMW", "Fiat" ] }; x = myObj.cars[0]; document.getElementById("demo").innerHTML = x; </script> </body> </html>
  • 13. Model Questions: 1. How do you round the number 7.25, to the nearest integer? (a) Math.round(7.25) (b) Math.rnd(7.25) (c) Math.rnd(7.25) (d) round(7.25) 2. How do you find the number with the highest value of x and y? (a) top(x, y) (b) ceil(x, y) (c) Math.ceil(x, y) (d) Math.max(x, y)
  • 14. Model Questions: (Cont.) 3. Is JavaScript case-sensitive? (a) True (b) False 4. Which symbol is used in the beginning of jQuery code ? (a) ? (b) @ (c) $ (d) * 5. The correct syntax for a conditional statement to execute following code if “x” is NOT equal to 8? (a) if x =! 8 then (b) if (x<> 8) (c) if x<>8 then (d) if (x != 8)