23.04.2013 Views

javascript

javascript

javascript

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ INDEX<br />

464<br />

creating, 217<br />

querying local variables saved to a closure,<br />

217<br />

coding cascade style, 264<br />

Coffee() constructor, 151<br />

COM objects, 256<br />

comma (,) operator, 93, 126<br />

comments, examples of commenting code, 2<br />

commonly scripted nodes, table of, 259<br />

compound statements, 97<br />

concat(), 25–27, 235–236<br />

concatenation operator, 3<br />

conditional advance loading<br />

console.dir(), 192<br />

console.log(), 189<br />

definition of, 185, 351<br />

extend(), 185, 190–192<br />

load-time branching, 185<br />

new ECMAScript 5 static methods, list of,<br />

185<br />

Object.create(), 188<br />

Object.defineProperties(), 187<br />

Object.defineProperty(), 186–187<br />

setting a function’s value according to a<br />

feature’s availability, 185<br />

toString(), 189<br />

when to use, 195<br />

See also conditional statements<br />

conditional statements<br />

blocks and child statements, 97<br />

boolean expressions, 97<br />

compound statements, 97<br />

definition of, 97<br />

dynamic nature of, 97<br />

if statement, 98<br />

namePirate() code example, 129<br />

replacing conditionals with an object or<br />

array query, 129<br />

switch statement, 107<br />

techniques for making conditionals run<br />

faster, 129<br />

See also conditional advance loading;<br />

looping statements<br />

configuration objects, passing, 222<br />

console.dir(), 147, 168, 192<br />

console.log(), 189<br />

constructors, 25, 54<br />

Chocolate() constructor, 152<br />

Coffee() constructor, 151<br />

console.dir(), 147<br />

creating objects with a constructor, 145<br />

definition of, 146<br />

duplicating a constructor, 169<br />

invoking a constructor with new, 146<br />

MintChocolateChunk() constructor, 154<br />

naming, 146<br />

prototype object, 146<br />

this private variable, 146<br />

VanillaBean() constructor, 149<br />

wildMaineBlueberry object, 146<br />

WildMaineBlueberry(), 147–148<br />

See also functions; objects<br />

container.gif, 351<br />

continue statement, 118<br />

controlling JavaScript’s flow, 97<br />

cookies<br />

decodeURIComponent(), 402<br />

document.cookie, 401, 405<br />

getCookie(), 401–403<br />

giving JavaScript a memory, 401<br />

indexOf(), 401–402<br />

prepSkinKeys(), 404<br />

presetSkin(), 403–404, 406<br />

substring(), 402<br />

swapSkinByKey(), 404–405<br />

ten.html, 406<br />

ten.js, 401<br />

user’s preferences, getting, 401<br />

user’s preferences, setting, 404<br />

user’s skin preference, setting, 403<br />

writing and reading cookies, 401<br />

createElem(), 294–295, 422, 428, 433, 437, 443<br />

createXHR(), 423–425<br />

CSS<br />

@ directives, 322<br />

adding or deleting rules, 327<br />

addRule(), 329, 340<br />

addSheet(), 340–343<br />

appendChild(), 340

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!