Book Image

Web Design Blueprints

Book Image

Web Design Blueprints

Overview of this book

The book delivers simple instructions on how to design and build modern Web using the latest trends in web development. You will learn how to design responsive websites, created with modern Flat User Interface design patterns, build deep-scrolling websites with parallax 3D effects, and roll-your-own single-page applications. Finally, you'll work through an awesome chapter that combines them all. Each chapter features actual lines of code that you can apply right away.
Table of Contents (12 chapters)
Web Design Blueprints
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Creating utility functions


Now that the home content script is still running, move on to some utility functions. We next want to begin creating scripts that provide utility functions.

Creating a services layer for AJAX

These will all be contained in a services object, so at the end of the script, create a new object variable called services.

var services = {};

The first thing the services layer will handle will be an AJAX call. We want to be able to use this to get the content asynchronously and placed into a DIV element. So, to demonstrate this, let's break the app into some separate concerns.

Creating and using the file structure

Let's start building out our application structure now, shall we? Inside your app folder is where all the pages for the Single Page Application will live. Each page will live in its own folder with everything it needs.