JavaScript for Absolute Beginners (Getting Started) by Terry McNavage

By Terry McNavage

When you are new to either JavaScript and programming, this hands-on publication is for you. instead of staring blankly at gobbledygook, you will discover JavaScript via getting into and operating hundreds of thousands of code samples in Firebug, a unfastened JavaScript debugger. Then within the final chapters, you will depart the security of Firebug and hand-code an uber cool JavaScript software on your hottest textual content editor. Written in a pleasant, attractive narrative variety, this leading edge JavaScript instructional covers the subsequent necessities: center JavaScript syntax, similar to price forms, operators, expressions, and statements supplied through ECMAScript. positive factors for manipulating XHTML, CSS, and occasions supplied by way of DOM. Object-oriented JavaScript, together with prototypal and classical inheritance, deep replica, and mixins. Closure, lazy loading, improve conditional loading, chaining, currying, memoization, modules, callbacks, recursion, and different robust functionality thoughts. Encoding facts with JSON or XML. distant scripting with JSON-P or XMLHttpRequest Drag-and-drop, lively scrollers, dermis swappers, and different cool behaviors. Optimizations to make sure your scripts run snappy. Formatting and naming conventions to avoid you from having a look like a greenhorn. New ECMAScript five, DOM three, and HTML five good points reminiscent of Object.create(), Function.prototype.bind(), strict mode, querySelector(), querySelectorAll(), and getElementsByClassName(). As you will discover, as a result of its clean procedure, this ebook is under no circumstances watered down. for that reason, over the process your trip, you'll pass from JavaScript newbie to wizard, buying the abilities recruiters hope.

Show description

Read or Download JavaScript for Absolute Beginners (Getting Started) PDF

Best programming: programming languages books

Objektorientierte Programmiersprache C++: Vollständige Einführung anhand von Beispielen (VDI-Buch) (German Edition)

In diesem Werk werden alle Aspekte der Sprache C++ behandelt, deshalb ist das Buch ebenso für Einsteiger, mit oder ohne Vorkenntnisse über eine andere Programmiersprache, als auch für Umsteiger von anderen Programmiersprachen bzw. C-Programmierer geeignet. Die Darstellung der Sachverhalte erfolgt knapp und systematisch, die Beispiele sind kurz, prägnant und compiler- unabhängig und auf allen Rechnern mit C++ 2.

Extra resources for JavaScript for Absolute Beginners (Getting Started)

Sample text

Var iceCream = [ ]; Now add an element to iceCream like so: var iceCream = [ "Chocolate Fudge Brownie" ]; Just as object members are separated by commas, so too are array elements. We would add my second favorite flavor like so: var iceCream = [ "Chocolate Fudge Brownie", "Half Baked" ]; Then continue separating elements with commas to fill in the rest of my top ten. Note that final element, "Mission to Marzipan", is not followed by a comma. Note too that JavaScript numbers flavors from 0 to 9.

But, if I’m still running when I’m 90, maybe I’ll give that a try! 4 CHAPTER 1 ■ REPRESENTING DATA WITH VALUES Figure 1–3. Doing some math with numbers ■ Note JavaScript’s value type conversion feature is covered more fully in Chapter 2. Creating a Boolean Literal Sometimes you will want a simple yes or no answer from JavaScript. In those circumstances, the return value for an expression will be true for yes and false for no. Click Clear in both Firebug panels, and let’s ask JavaScript whether Chocolate Fudge Brownie is just chocolate ice cream.

Click Clear in both Firebug panels, and then enter and run the following, before verifying this and the previous few samples with Figure 1–5. var newYorkSuperFudgeChunk = 4 * 300 + " calories per pint"; newYorkSuperFudgeChunk; // "1200 calories per pint" 6 CHAPTER 1 ■ REPRESENTING DATA WITH VALUES Figure 1–5. Creating validly named variables The reason this works is that = has very low precedence compared to * and +. In Chapter 3, we’ll explore precedence, which determines the pecking order of operators more fully.

Download PDF sample

Rated 4.82 of 5 – based on 41 votes