Conventions
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "In the preceding CSS code, we first defined some basic styles for the box
, boxsizer
, and clear
CSS classes."
A block of code is set as follows:
$.each([3, 5, 7], function(index){ console.log(this + 1 + '!'); });
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
$('#categoriesSelector').change(function() {
var $selector = $(this);
var message = { categoryID: $selector.val() };
broker.trigger('dashboardCategorySelect', [message]);
});
We are following Google's JavaScript Style Guide, except from using four spaces for indentation, in order to improve the readability of the code in the book. In short, we are placing curly brackets on top and use single quotes for string literals.
Note
For more information on Google's JavaScript Style Guide you can visit the following URL: https://google.github.io/styleguide/javascriptguide.xml
Any command-line input or output is written as follows:
npm install jquery
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "The jQuery Object returned is an Array-like object that acts as a wrapper object and carries the collection of the retrieved elements."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.