Chapter 13: Building a Foundation

Before we get into the meat and potatoes of the application, we should start with the basic structural and foundational pieces so the rest of our code has something to lean on. We’ll start off by creating our Application object.


Create a file called QuizEngine.js and place it in the js folder. It’ll contain the following code:


var QuizEngine = (function(){

    var Application = Marionette.Application.extend({});

    var application = new Application();

        header: '[data-region=header]', // Not used right now
        body: '[data-region=body]',
        footer: '[data-region=footer]' // Not used right now

    application.on('initialize:after', function() {

Get Better Backbone Applications with MarionetteJS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.