12.07.2015 Views

Pro JavaScript for Web Apps pdf - EBook Free Download

Pro JavaScript for Web Apps pdf - EBook Free Download

Pro JavaScript for Web Apps pdf - EBook Free Download

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

• INDEXHTML5 local storage feature, with offline webapplications (cont.)cached CheeseLux web app, 150–153createDialog function, 156–157enhanceViewModel function, 153–154script element changes, 155–156persistent <strong>for</strong>ms, 142–143session storagebenefits, 148–149semi-persistent observable data item, 149synchronizing view models, 144KO subscribe method, 146main document modification, 147–148persistentObservable function, 144, 146–147StorageEvent object, 145HTMLElement properties, 35• IIndexedDB, 156DBO object, 158–160locating objectsusing cursor, 166using Index, 167by key, 165–166onupgradeneeded property, 160–161success outcomes, 161to web application, 162–165<strong>Web</strong>SQL, 157working principle, 157• J<strong>JavaScript</strong>dependencies in libraries, 238AMD module (see Asynchronous moduledefinition (AMD))assumed dependency, 238–239directly resolved dependency, 240double-loading problem, 243–244issues, 240–243global namespaces, 229–230global variables, 230namespacesconfiguration, 233–234definition, 230–231nested, 231–232nested, using a function, 232–233self-executing function, 234–235naming collision, 229property, method and function, 235–238unit testing, 253adding tests, 254–256jQuery, 257–258QUnit, 253–254<strong>JavaScript</strong> libraries, 7<strong>JavaScript</strong> polyfill libraries, 129jQueryaddClass method, 23bind method, change and keyup events, 32–33custom selectors, 20hover method, 26importing, 15–18method chaining, 23methods <strong>for</strong> inserting elements in document,22statement, 19UI button, 43–44UI toolkit, 42–43jQuery Mobilecontent changes, 214–215event sequence, 211–212disabling automatic processing, 212–213pageinit event, 213–214pages, 201–202widgets, 202• KKnockout (KO)data bindings, 51definition, 49library, 49–53ko object, 50• LLatent content, 29, 31–32• MMethod chaining, 23Method pairs, 23Mobile browser emulator, 7Mobile <strong>Web</strong> <strong>Apps</strong>, 195CheeseLux Mobile <strong>Web</strong> Appbasic implementation, 209<strong>for</strong>matText data binding, 210–211262www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!