Index Index

–(pipe) as alternation symbol, 179 Symbols 32-bit PNG images in IE7, 459–460 - - (decrement) operator, 75, 80 & (AND) Bitwise logical operator, 72–73, 80 $ (dollar sign) in replacement symbols, 185 A % (modulus) operator, 74–75, 80 absolute positioning (CSS), 443–444, 447–451 ( ) (parentheses) in expressions, 85 accelerator plugins (browsers), 574 , (comma) accidental closures, 125 object literals and, 46 Acid Tests, 406 operator, 75 AC_Quicktime.js JavaScript library, 607 “ ” (quotation marks) (AMF), 523 in JSON, 557 ActionScript string literals and, 43–44 3.0, 596 ‘ ’ (single quotes) in string literals, 43–44 in Flash, 7 . . . (ellipses) for shortening strings, 195 ActiveX, security and, 484–485 /* and */ in comments, 48 ActiveXObject (global), 725 / / (forward slashes) addBehavior() method, 492 in comments, 48 in regular expression literals, 46 cross-domain Ajax and, 523–524 ?: (conditional) operator, 75–76 Flash storage, 502–505 ? (match zero or one times symbol), 175 security and, 485 @ (at) symbol, 48 AIR (Adobe Integrated Runtime), 7 \ (backslash) Ajax, 511–531 in instances of regular expressions, “Ajax: A New Approach to Web Applications”, 173–174 511 in JSON, 558 browser compatibility and, 36 ^ (caret) symbol in string groups, 177 cross-domain Ajax. See cross-domain Ajax ^ (XOR) Bitwise logical operator, 73 history and bookmarking, 525–530 __ (underscores) for private properties/ JSON and, 567–569 methods, 262 XMLHttpRequest. See XMLHttpRequest (XHR) { } (curly braces) alarmArray, 247–248 blocks and, 47 COPYRIGHTEDalert() MATERIAL dialogue boxes, 289–290 object literals and, 46 alpha channel feature, 459 | (OR) Bitwise logical operator, 72 alphabetical string comparison, 163–164 + (concatenate operator), 159–160 alternation symbol (–), 179 ++ increment operator, 75, 80 AMF (Action Message Format), 523 + (plus) operator, 21 anchor/link objects, 951–952 !== and != equality operators, 65 .anchor(anchorName) method, 167 === and == equality operators, 65, 66 animation !== and != equality operators, 66 with canvases (browsers), 576–577 = (equals) operator, 66 DHTML, 451

bbindex.inddindex.indd 975975 66/25/09/25/09 88:23:05:23:05 PPMM anonymous functions

anonymous functions defined, 229 as closures, 47 iterating and, 224 defined, 105 passing argument and, 114 Applets, Java, 591–594 associativity, operators and, 80–81 apply() method, 126–127, 131 asynchronous connections (XMLHttpRequest), , 16 515–516 Area object, 911–912 Asynchronous JavaScript and XML. See Ajax arguments attack surface (Ajax applications), 518 apply() method, 127 attributes argument hashes, 115–118 cookie attributes, 489–490 call() method, 127 CSS, 407–416 creating SQLite databases, 499 defined (DOM), 356 defining (functions), 104 Number.POSITIVE_INFINITY/Number.NEGATIVE_ for loops and, 87 INFINITY, 209 object, 114–115 XML/HTML documents, 540 optional, overloading and, 112–114 authentication passing by value vs. reference, 106 Authenticode, 480, 484 passing to functions (replace method), Cross-site request forgery and, 478 186–187 autosizing textareas, 395 arithmetic expressions, 61 arithmetic operators (JavaScript), 74, 654–660 Array object (global), 725–746 B arrays Back buttons, Ajax and, 525–526 for .. in loops and, 89 background-position attribute (DOM), 440 adding elements to. See elements, adding to backward compatibility, comparison operators arrays and, 66 arguments object and, 114 basic event model, 306–308 array literals, 45 behavior feature (IE 5), 492 Array object, basics, 217–218 big-endian order, bitwise operators and, 70–71 array of arrays, 220 bindings, event, 306–307, 326 Array.join() method, 233–234 bitwise operators (JavaScript), 62, 70–73, associative, 114, 229–231 669–674 creating, 218–219 block operator ({ }), 84 detecting, 220–222 blocks indexed, 219 basics, 47 iterating over, 223–224 script, 19 loops and, 643 blur() method, 385, 386 multi-dimensional, 220 body object, 920–922 objects as, 255–256 BOM (Browser Object Model), 9–10, 271 as reference types, 231–233 bookmarking, Ajax and, 525–530 removing elements from, 227–229 Booleans size of, 223 Boolean literals, 43 strings and, 196–197, 233–234 Boolean object, 199–203, 746 ASCII, 40 boolean values, 199 assignment operators (JavaScript) comparison operators and, 64 basics, 66–68 converting types to, 56 defined, 62 logical operators and, 68–69 reference, 660–669 working with, 200–201 associative arrays BoxObject, 449 basics, 229–231 break statements, 93–95

976

bbindex.inddindex.indd 976976 66/25/09/25/09 8:23:068:23:06 PMPM Charles Proxy Debugger Index breakpoints, setting (), 623 conditional compilation feature, 577–578 browsers CSS Transforms, 578–580 array iterator performance, testing, 223–224 Gears plugin (Google), 582–586 browser-based development (JavaScript), 4–5 Geolocation API, 580–582 comparing features of, 164 overview of unique, 573 concurrent requests and, 633 search providers, 586 detecting, 291–293 Vector Markup Language (VML), 587–588 detection class, building, 295–300 Web Workers threading module, 588–589 DOM storage events and, 496, 497 WorkerPool threading module (Gears), event compatibility comparison, 336–338 584–586 global object in, 130–131 bubbled statements, 96 gZip and, 635 bubbling, event, 319–320, 343 navigator object, 292 buttons numbers and, 204 Back and Forward (Ajax), 525 performance. See performance tuning basics, 386 replacement scheme symbols, 185 BUTTON/SUBMIT/RESET objects, 939 screen object, 294–295 custom submit, 381 security. See security radio, 387–389 serializing XML to text in, 539 status bar, 276 storage limits, 506 C string performance in, 160–161 caching support for E4X, 553 cache variable, 507–508 support of statements, 82–83 hashes for, 231 supporting ExternalInterface (Flash), 503 page weight reduction and, 634 supporting global object functions, 132–133 calls supporting XPath, 362 call() method, 127, 131 testing with, 18–19 call stacks, 96 W3C DOM storage and, 495 repeated math calls, 214–215 WYSIWYGs and, 396–397 canvas elements (browsers), 575–577 XMLHttpRequest and. See XMLHttpRequest Canvas object, 912–914 (XHR) capitalization, strings and, 168 XPath queries and, 544–545 caption object, 946 browsers, JavaScript in capture mode for IE mouse events, 322–323 cross-browser compatibility, 36 capture phase (event propagation), 320–322 deferred scripts, 30–31 carriage returns, string literals and, 44 DOM, 23–24 Cascading Style Sheets (CSS). See CSS dynamically loaded scripts, 33–34 (Cascading Style Sheets) event-driven scripts, 31–32 case sensitivity execution and load order, 27 JavaScript and, 41 external scripts, 30 strings and, 167–168 inline scripts, 28–29 catch() statement, 616