Course Hero Logo

The Problem with Native JavaScript APIs_ External JavaScript Libraries Still Matter ( PDFDrive ).pdf

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 8 out of 16 pages.

External JavaScript LibrariesStill MatterNicholas C. ZakasThe Problem withNative JavaScriptAPIs
JavaScript Starter KitThe Tools You Need to Get Started with JavaScriptJavaScript is now a languageevery developer should know.Mike Loukides, Vice President of Content Strategy for O Reilly MediaBuy any two titlesand get the 3rd Free.Use discount code:OPC10Or, buy them all forjust$149/ 60% off.Use discount code:JSSKT
The Problem with NativeJavaScript APIsNicholas C. ZakasBeijingCambridgeFarnhamKölnSebastopolTokyo
The Problem with Native JavaScript APIsby Nicholas C. ZakasCopyright © 2012 O’Reilly Media. All rights reserved.Printed in the United States of America.Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol,CA 95472.O’Reilly books may be purchased for educational, business, or sales promotionaluse. Online editions are also available for most titles (line.com). For more information, contact our corporate/institutional sales depart-ment: 800-998-9938 or[email protected].Editor:Mac SlocumProduction Editor:Melanie YarbroughCover Designer:Karen MontgomeryInterior Designer:David FutatoIllustrator:Robert RomanoJuly 2012:First Edition.Revision History for the First Edition:2012-07-20First releaseSeefor release details.Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are regis-tered trademarks of O’Reilly Media, Inc.The Problem with Native JavaScript APIsand related trade dress are trademarks of O’Reilly Media, Inc.Many of the designations used by manufacturers and sellers to distinguish theirproducts are claimed as trademarks. Where those designations appear in this book,and O’Reilly Media, Inc., was aware of a trademark claim, the designations havebeen printed in caps or initial caps.While every precaution has been taken in the preparation of this book, the publisherand authors assume no responsibility for errors or omissions, or for damages re-sulting from the use of the information contained herein.ISBN: 978-1-449-33995-11344364955
Table of ContentsThe Problem with Native JavaScript APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1Issues with Native APIs2Case Study: matchMedia()3Facades and Polyfills5What to Do?6iii
The Problem with NativeJavaScript APIsThe past couple of years have seen unprecedented changes in web browsertechnology. For most of the history of the Web, change came at an agonizinglyslow pace, as minor features took years to stabilize and roll out across brows-ers. Then came HTML5. All of a sudden, browsers were being released faster.New features were being implemented almost as soon as they had been spec’d.Features inspired by popular JavaScript libraries became standardized as partof the browser’s JavaScript API.Shortly after that, there came a wave of proclamations. “You don’t even needa JavaScript library anymore,” some said. “You can just use the native Java-Script APIs to do the same thing.” Looking at the browser’s JavaScript land-scape, it’s easy to see why people would say that. Retrieving document objectmodel (DOM) elements using CSS selectors is natively supported throughquerySelector()andquerySelectorAll(). This capability was heavily inspiredbyjQuery, the library responsible for popularizing the use of CSS selectors toretrieve and manipulate DOM elements. You can also retrieve elements simplyusing a CSS class via thegetElementsByClassName()

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 16 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
NoProfessor
Tags
Internet Explorer, Document Object Model, Web browser, Mozilla Firefox, Safari, matchMedia

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture