JavaScript and JSON Essentials
eBook - ePub

JavaScript and JSON Essentials

Sai Srinivas Sriparasa

Condividi libro
  1. 120 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

JavaScript and JSON Essentials

Sai Srinivas Sriparasa

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

In Detail

The exchange of data over the Internet has been carried out since its inception. Delimiter-separated lists such as CSV and tag-separated languages such as XML are very popular, yet they are considered to be verbose by a section of developers. JSON (JavaScript Object Notation) is a lightweight text-based code to create objects to transfer data over the Internet. It is a data exchange format that is human-readable (like XML, but without the markup around your actual payload) and its syntax is a subset of the JavaScript language that was standardized in 1999.

JavaScript and JSON Essentials is a step-by-step guide that will introduce you to JSON and help you understand how the lightweight JSON data format can be used in different ways either to store data locally or to transfer data over the Internet. This book will teach you how to use JSON effectively with JavaScript.

This book begins with a brief refresher course on JavaScript before taking you through how JSON data can be transferred via synchronous, asynchronous, and cross-domain asynchronous HTTP calls. JSON is not just about data transfer; this book throws light on the alternate implementations of JSON as well.

You will learn the data types that JavaScript uses and how those data types can be used in JSON. You will go through the concepts of how to create, update, parse, and delete a JSON object. You will also look at the different techniques of loading a JSON file onto a web page, how to use jQuery to traverse through an object, and how to perform access operations. You will also go over a few resources that will make debugging JSON quick and easy.

Approach

The book follows a tutorial-based approach and will teach you how to work with JSON tools, design JSON objects, and how to use different techniques to handle JSON data.

Who this book is for

This book is a great resource for developers who would like to learn more about JSON and who wish to apply it in their own projects. It will be useful to have some prior knowledge of HTML and JavaScript to help you understand the concepts covered in this book. Some familiarity with a server-side language such as PHP, C#, or Python would also be beneficial, but this is not compulsory.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
JavaScript and JSON Essentials è disponibile online in formato PDF/ePub?
Sì, puoi accedere a JavaScript and JSON Essentials di Sai Srinivas Sriparasa in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Web Programming. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2013
ISBN
9781783286034
Edizione
1

JavaScript and JSON Essentials


Table of Contents

JavaScript and JSON Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. JavaScript Basics
Variables in JavaScript
Arrays
Objects
The Carousel application
Summary
2. Getting Started with JSON
The Hello World program with JSON
Datatypes in JSON
Languages that support JSON
PHP
Python
Summary
3. Working with Real-time JSON
Accessing objects in JSON
Performing complex operations
Modifying JSON
Summary
4. AJAX Calls with JSON Data
Requirements for AJAX
Hosting JSON
Making your first AJAX call
Parsing JSON data
Summary
5. Cross-domain Asynchronous Requests
Making GET and POST AJAX calls with JSON data
The problem with cross-domain AJAX calls
Introduction to JSONP
Implementing JSONP
Summary
6. Building the Carousel Application
Setting up the application
Building the JSON file for the Carousel application
Creating the Carousel application with jQuery Cycle
Summary
7. Alternate Implementations of JSON
Dependency management
JSON for storing metadata
Comparisons with YAML
Summary
8. Debugging JSON
Using the developer tools
Validating JSON
Formatting JSON
Summary
Index

JavaScript and JSON Essentials

Copyright © 2013 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2013
Production Reference: 1181013
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-603-4
www.packtpub.com
Cover image by Ravaji Babu ()

Credits

Author
Sai Srinivas Sriparasa
Reviewers
Marco Lüthy
Shameera Rathnayaka
Acquisition Editor
Joanne Fitzpatrick
Lead Technical Editor
Shaon Basu
Technical Editors
Pooja Nair
Anusri Ramchandran
Amit Shetty
Ritika Singh
Copy Editors
Alisha Aranha
Brandt D’Mello
Lavina Pereira
Project Coordinator
Akash Poojary
Proofreader
Ting Baker
Indexer
Monica Ajmera Mehta
Production Coordinator
Kirtee Shingan
Cover Work
Kirtee Shingan

About the Author

Sai Srinivas Sriparasa is a web developer and an open source evangelist living in the Stamford area. Sai was the lead developer for building Dr. Oz’s website, and has led teams for companies such as Sprint Nextel, West Interactive, and Apple. Sai’s repertoire includes JavaScript, PHP, Python, HTML5, responsive web development, ASP.NET, C#, and Silverlight.

About the Reviewers

Marco Lüthy is a Swiss-born creator, designer, developer, and engineer for Internet-enabled applications and has over 10 years of experience working on projects deployed over the Internet. Occasionally he likes to dabble in content creation of the written and photographic kind. Marco’s current focus is the Tokyo-based Internet media and application development firm Robotag Media, Inc., where he is co-founder and resident factotum working on making many useful, pretty things for us all to use and play with.
Shameera Rathnayaka is an Apache Axis2 committer and a PMC member, and has been actively contributing to several Apache projects for the past few years. He holds a B.Sc. Engineering (Hons) in Computer Science and Engineering from the University of Moratuwa, Sri Lanka. He first started his open source contributions with the Apache Axis2 project, where he implemented JDK 7 Enum support for Apache Axis2 as well as stream-based high performance solutions for JSON<-->XML lossless transformation. He is a Google Summer of Code participant with Apache Axis2 and Apache Airavata projects and has reviewed the book Instant GSON, Sandeep Kumar Patel, Packt Publishing.
Shameera currently works as a Software Engineer at WSO2 Inc., an open...

Indice dei contenuti