O'Reilly logo

Web Design Blueprints by Benjamin LaGrone

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required