更新时间:2021-08-27 19:03:50
封面
Title Page
Copyright and Credits
JavaScript and JSON Essentials Second Edition
Dedication
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the authors
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Getting Started with JSON
JSON a data exchange format
The Hello World program with JSON
How is JSON stored in memory?
Datatypes in JSON
Languages that support JSON
JSON implementation in PHP
JSON implementation in Python
Summary
The JSON Structures
Inserting external JavaScript
Accessing objects in JSON
Performing complex operations
Modifying JSON
AJAX Requests with JSON
Basic web operations
Synchronous vs. asynchronous
Requirements for AJAX
Setting up a node.js server
Hosting JSON
Making your first AJAX call
Traditional callbacks
Handling asynchronousity using a promise
New ECMAScript generators
Parsing JSON data
Cross-Domain Asynchronous Requests
The API story
Making GET and POST AJAX calls with JSON data
The problem with cross-domain AJAX calls
Introduction to JSONP
Implementation at server-side
Implementing JSONP at client-side (browsers)
Debugging JSON
Using the developer tools
Validating JSON
Formatting JSON
Building the Carousel Application
Setting up the Carousel application
Building the JSON file for the Carousel application
Creating the Carousel application with jQuery Cycle
Introducing Bootstrap
Setting up Bootstrap
Bootstrap responsiveness and styles
Alternate Implementations of JSON
Dependency management
Using composer.json in PHP
Node.js using the package.json registry
JSON for storing application configurations
Configuration in PHP and Python
Configuration in frontend frameworks – Angular 5
Linting with tslint.json
Configuring TypeScript using tsconfig.json
Using package.json and package-lock.json files
Using the angular-cli.json file
JSON for storing application metadata
Metadata in Angular 5
Constants in Node.js
Template embedding
Comparisons with YAML
Introduction to hapi.js
Basic server setup using JSON
Using JSON metadata and constants
Configuring API using JSON
Configuring a plugin in hapi
Testing the APIs using POSTMAN
Testing hapi server APIs using POSTMAN
JSON beneath POSTMAN
Storing JSON Documents in MongoDB
Setting up MongoDB
Connecting the hapi app with MongoDB
JSON versus BSON
Collections