Contents

About the Author

About the Technical Reviewer

Acknowledgments

Introduction

image Chapter 1: JavaScript Basics

JavaScript History

JavaScript Essentials

Values

Primitive Types

Expressions

Operators

Statements

Line Terminators

Control Statements

Block Statements

Truthy/Falsy

Loop Statements

Declarations

Variables

Functions

Summary

Key Points from This Chapter

image Chapter 2: Special Objects

Objects

Objects Are Collections

Built-in Objects

Object

Creating Objects

Access Notation

Array

Object Literals

Designing Literals

The Object Literal

The Array Literal

Summary

Key Points from This Chapter

image Chapter 3: String Manipulation

String Concatenation

The String object

Creating String objects

The Interface of the String object

length

toString

charAt

indexOf

lastIndexOf

match

replace

slice

substr

split

toUpperCase

toLowerCase

The Implicit String object

Summary

Key Points from This Chapter

image Chapter 4: Introducing JSON

History

JSON Grammar

Composite Structures

JSON Values

JSON Tokens

Summary

Key Points from This Chapter

image Chapter 5: Creating JSON

The Serialization Process—Demystified

The JSON Object

stringify

Summary

Key Points from This Chapter

image Chapter 6: Parsing JSON

JSON.parse

eval

reviver

Summary

Key Points from This Chapter

image Chapter 7: Persisting JSON: I

HTTP Cookie

Syntax

document.cookie

Web Storage

Web Storage Interface

Summary

Key Points from This Chapter

image Chapter 8: Data Interchange

Hypertext Transfer Protocol

HTTP-Request

HTTP Response

Ajax

XMLHttpRequest Interface

Global Aspects

The Request Aspect

The Response Aspect

Obtaining the Response

Summary

Key Points from This Chapter

image Chapter 9: X-Origin Resources

Same-Origin Policy

Circumventing Same-Origin Policy

CORS

The Proxy

JSONP

Summary

Key Points from This Chapter

image Chapter 10: Serving JSON

Node.JS

Windows Installation

Mac Installation

Building an HTTP Server

Node HTTP Web Server

Node API

Modules

The HTTP Module

http.createServer

http.IncomingMessage

http.ServerResponse

http.Server

CORS-Enabled Server

JSONP Server

The Proxy Server

http.request

http.Stream

http.ClientRequest

Summary

Key Points from This Chapter

image Chapter 11: Posting JSON

Request Entity Body

HTML Form POST

Processing a JSON POST

Preflight Request

OPTIONS Request Method

What Determines Preflight

Summary

Key Points from This Chapter

image Chapter 12: Persisting JSON: II

CouchDB

Windows Installation

Mac Installation

Working with CouchDB

Futon

Creating Views

Creating Our First Custom View

Connecting Node and CouchDB

Cradle for Node

Working with Databases

Cradle Database API

Creating Documents via Cradle

Creating Design Documents via Cradle

Summary

Key Points from This Chapter

image Chapter 13: Working with Templates

Templating Engine

Handlebars

Installation

Working with Handlebars

A Basic Expression

The Role of <script>

Compiling a Template

Giving Context to Our Template

Multiple Placeholders

Complex JSON Structures

Block Expressions

Block Expressions and Arrays

Applying Logic to Logic-less Templates

Helpers

Summary

Key Points from This Chapter

image Chapter 14: Putting It All Together

Twitter

Twitter Apps

Keys and Access Tokens

Public Stream

Your User Access Token

#Trending

Node.js

Twitter Module

Incorporating the Twitter Module

Streaming API (Stable)

Statuses/Filter

CouchDB

Incorporating the Cradle Module

Creating a View

Enabling CORS

Ajax

Requesting Ranges

Handlebars

Summary

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.51.228