-
Book Overview & Buying
-
Table Of Contents
Backbone.js Patterns and Best Practices
By :
Asynchronous Module Definition (AMD) is a JavaScript API used to define modules and load module dependencies asynchronously. It is a fairly new yet very robust concept that many developers are adopting nowadays. In Chapter 7, Organizing Backbone Applications – Structure, Optimize, and Deploy, we covered AMD with Require.js in detail. If you need more details on this library, we recommend you visit http://requirejs.org/ to get a complete overview and then come back to this section.
In general, Require.js treats every file's content as JavaScript. So, we cannot load our template files, if they aren't JavaScript files, in the same manner as JavaScript files. Fortunately for templates, there is a text plugin that allows us to load text-based dependencies. Any file that we load using this file will be treated as a text file and the content that we receive will be a string; it can be used easily with your template methods. To use this plugin...
Change the font size
Change margin width
Change background colour