Edit in JSFiddle

// This is a snippet!

var PageView = Backbone.View.extend({
    className: 'page',

    render: function(callback) {
        if(this.model.get('data')) {
            this.$el.html(this.model.get('data'));
            return callback(this);
        }
        else {
            var self = this;

            $.get(this.model.get('url'), function(data) {
                self.model.set('data', data);
                self.$el.html(data);

                return callback(self);
            });
        }
    },

    open: function() {
        if(this.$nav) {
            $('nav ul li').removeClass('active');
            this.$nav.addClass('active');
        }

        var $assets = $('.page-dependencies');
        // Clear old assets
        $assets.empty();

        // Load Assets
        if(this.model.get('assets')) {
            this.model.get('assets').forEach(function(asset) {
                if(asset.endsWith('.js')) {
                    $assets.append($('<script>', {
                      type: 'text/javascript', src: asset
                    }));
                }
                else if(asset.endsWith('.css')) {
                    $assets.append($('<link>', {rel: 'stylesheet', href: asset}));
                }
            });
        }
        // All pretty class name to distinguish pages from one another.
        // This is useful for styling particular pages and placing the styles in 
        // style.css
        this.$el.addClass(this.prettyClassName());
        // Add the page
        $('.ipad-stage .container').html(this.$el);
        // Page is opened!
        this.$el.trigger('pageOpened', [this.model]);
    },

    prettyClassName: function() {
        var title = this.model.get('title');
        // Lowercase
        title = title.toLowerCase();
        // Remove unwanted characters
        title = title.replace(/[^A-Za-z0-9\ \-]/g, '');
        // Replace spaces
        title = title.replace(/\s/g, '-');

        return title;
    }
});