Special Topic JSON. Introducing JSON JSON (JavaScript ObjectNotation): A data format based on the object literal format Advantage of JSON over XML – JSON.

Slides:



Advertisements
Similar presentations
Course work. Layout of the Main Window Achieved by nesting frames as shown below: Frames Welcome page should be home page.
Advertisements

JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Working with Forms. how are forms manipulated? the document object contains an array of forms objects, one for each form, in document order –forms[] any.
Molecular Biomedical Informatics Web Programming 1.
Copyright © Steven W. Johnson
SE 480: Client Side Scripting Languages Week 10: Ajax Data Sources Copyright © Steven W. Johnson October 1, 2014.
TECH 2018 (Week 16) Topic: JavaScript Parminder Kang Home: Phones Off Please.
XML: text format Dr Andy Evans. Text-based data formats As data space has become cheaper, people have moved away from binary data formats. Text easier.
Technology Reviews :XSL Park, Ho-gun. What is XSL Extensible Style sheet LanguageExtensible Style sheet Language An XML-based language used to.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
The Web Warrior Guide to Web Design Technologies
Lesson 4: Formatting Input Data for Arithmetic
JSON Valery Ivanov.
9. AJAX & RIA. 2 Motto: O! call back yesterday, bid time return. — William Shakespeare.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
15-Jul-15 JSON. JSON example “JSON” stands for “JavaScript Object Notation” Despite the name, JSON is a (mostly) language-independent way of specifying.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Introduction to Internet Engineering Tutorial 7 All about Assignment 2 By Tse Hok
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
JSON The Fat Free Alternative to XML. Data Interchange The key idea in Ajax. An alternative to page replacement. Applications delivered as pages. How.
Objects Objects are just a way of representing data. They provide a way to organize a collection of data into a single unit. If objects are nouns, adjectives.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Lecture 13 – XML and JSON SFDV3011 – Advanced Web Development Reference: 1.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
CIS 451: Introduction to XML Dr. Ralph D. Westfall October, 2011.
Chapter 3: Data Types and Operators JavaScript - Introductory.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 13 – Advanced.
Created By: Kevin Cherry. A library that creates a display to run on top of your game allowing you to retrieve/set values and invoke methods.
JavaScript, Fourth Edition
Creating Dynamic Webpages
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
PROGRAMMING IN C#. Collection Classes (C# Programming Guide) The.NET Framework provides specialized classes for data storage and retrieval. These classes.
JSON – Java Script Object Notation. What is JSON JSON is a data interchange format Interactive Web 2.0 applications, no more use page replacement. Data.
AJAX. Ajax  $.get  $.post  $.getJSON  $.ajax  json and xml  Looping over data results, success and error callbacks.
IS2802 Introduction to Multimedia Applications for Business Lecture 4: JavaScript, Loops, and Conditional Statements Rob Gleasure
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
MIT-AITI: Functions Defining and Invoking Functions Functions as Data Function Scope: The call Object Function Arguments: The arguments objects Function.
OVERVIEW AND PARSING JSON. What is JSON JavaScript Object Notation Used to format data Commonly used in Web as a vehicle to describe data being sent between.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
JavaScript, Sixth Edition
Introduction to Javascript. What is javascript?  The most popular web scripting language in the world  Used to produce rich thin client web applications.
JSON. JSON as an XML Alternative JSON is a light-weight alternative to XML for data- interchange JSON = JavaScript Object Notation It’s really language.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JSON (Copied from and from Prof Da Silva) Week 12 Web site:
JavaScript and Ajax Week 10 Web site:
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
#SummitNow The Share Widget Library 13 th November 2013 Dave Draper
XML & JSON. Background XML and JSON are to standard, textual data formats for representing arbitrary data – XML stands for “eXtensible Markup Language”
Programming Web Pages with JavaScript
Unit M Programming Web Pages with
AJAX and REST.
JSON.
JavaScript & jQuery AJAX.
MIS JavaScript and API Workshop (Part 3)
Intro to PHP.
Department of Computer Science Cal State East Bay, Hayward, CA
JavaScript CS 4640 Programming Languages for Web Applications
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Presentation transcript:

Special Topic JSON

Introducing JSON JSON (JavaScript ObjectNotation): A data format based on the object literal format Advantage of JSON over XML – JSON is a terse language with a minimum of extraneous characters

JSON Preferable to XML Similar to XML Text file object { “isbn”:” ”, “price”:”15.00” }

Introducing JSON JSON documents can contain several layers of nested values Size of a JSON data file can be further reduced through the use of array literals Following this general approach, can add more nested fields and arrays to achieve complicated data structures

Introducing JSON Advantage of JSON over XML – Easier to retrieve specific data values with JSON; its data structures can be treated as custom JavaScript objects with data fields referenced as object properties Disadvantage of JSON over XML – Less readable by the layperson

Introducing JSON Reading a JSON object with JavaScript – To retrieve a document containing a JSON object: req.responseText – To convert JSON text into a JavaScript object: var jsonData = eval( "(" + req.responseText + ")" );

Can Nest Widgets Smith Blogs Harris { “books” { “book1” : { “title”: “Widgets”, “Author”: “Smith”, “Price”: “20.00” } “book2”: { “title”: “Blogs”, “Author”: “Harris”, “Price”: “20.00” }

Array Literals [ ] Widgets Smith Blogs Harris { “books” { “book”: { “Price”: “20.00”, “title”: [“Widgets”,“Blogs”], “Author”: [“Smith”, “Harris”] } }

Array Literals/iterations Widgets Smith Blogs Harris { “books” { “book”: [ { “Price”: “15.00”, “title”: [“Widgets”,“Blogs”], “Author”: [“Smith”, “Harris”], } { “Price”: “20.00”, “title”: [“HTML”,“CSS”], “Author”: [“Langley”, “Benson”], } ] }

How to use HTTPRequest /GET/ send(null) Receive object responseTEXT Assign result to a variable, using EVAL function The eval() function evaluates or executes an argument To convert JSON text into an object eval() invokes the JavaScript compiler var myBooks = this.responseText var myBooks = eval( "(" + this.responseText+ ")" ); myBooks.books.book[0].price