These codes are examples from the book "Single Page Web Applications"