Secrets of the JavaScript Ninja by John Resig, Bear Bibeault, Josip Maras

By John Resig, Bear Bibeault, Josip Maras

Summary

More than ever, the internet is a common platform for all sorts of purposes, and JavaScript is the language of the net. in case you are fascinated about net improvement, it is not sufficient to be a good JavaScript coder. you have to be ninja-stealthy, effective, and prepared for something. This publication exhibits you how.

Purchase of the print booklet contains a unfastened e-book in PDF, Kindle, and ePub codecs from Manning Publications.

About the Technology

JavaScript is quickly changing into a common language for all sorts of program, even if on the internet, at the computing device, within the cloud, or on cellular units. for those who turn into a JavaScript professional, you may have a robust ability set that’s usable throughout these kind of domains.

About the Book

Secrets of the JavaScript Ninja, moment Edition makes use of sensible examples to obviously illustrate each one center inspiration and procedure. This thoroughly revised variation exhibits you ways to grasp key JavaScript techniques corresponding to services, closures, items, prototypes, and delivers. It covers APIs corresponding to the DOM, occasions, and timers. You’ll realize top perform strategies akin to checking out, and cross-browser improvement, all taught from the point of view of expert JavaScript practitioners.

What’s Inside

  • Writing more suitable code with features, items, and closures
  • Learning to prevent JavaScript software pitfalls
  • Using typical expressions to write down succinct text-processing code
  • Managing asynchronous code with promises
  • Fully revised to hide recommendations from ES6 and ES7

About the Reader

You don’t need to be a ninja to learn this book—just be prepared to turn into one. Are you ready?

About the Authors

John Resig is an stated JavaScript authority and the writer of the jQuery library. Bear Bibeault is an online developer and writer of the 1st version, in addition to coauthor of Ajax in Practice, Prototype and Scriptaculous in Action, and jQuery in Action from Manning. Josip Maras is a post-doctoral researcher and teacher.

Table of Contents

    PART 1 - WARMING UP

  1. JavaScript is everywhere
  2. Building the web page at runtime
  3. PART 2 - knowing FUNCTIONS

  4. First-class services for the beginner: definitions and arguments
  5. Functions for the journeyman: figuring out functionality invocation
  6. Functions for the grasp: closures and scopes
  7. Functions for the long run: turbines and promises
  8. PART three - DIGGING INTO items AND FORTIFYING YOUR CODE

  9. Object orientation with prototypes
  10. Controlling entry to objects
  11. Dealing with collections
  12. Wrangling ordinary expressions
  13. Code modularization techniques
  14. PART four - BROWSER RECONNAISSANCE

  15. Working the DOM
  16. Surviving events
  17. Developing cross-browser strategies

Show description

Read or Download Secrets of the JavaScript Ninja PDF

Similar client-server systems books

Distributed computing: a locality-sensitive approach

This quantity offers the locality-sensitive method of dispensed community algorithms-the usage of locality to simplify regulate constructions and algorithms and decrease their charges. the writer starts off with an introductory exposition of disbursed community algorithms targeting issues that illustrate the function of locality in dispensed algorithmic strategies.

Educational Algebra: A Theoretical and Empirical Approach (Mathematics Education Library)

This ebook takes a theoretical standpoint at the examine of college algebra, within which either semiotics and heritage happen. The Methodological layout allows the translation of particular phenomena and the inclusion of proof now not addressed in additional basic remedies. The e-book offers precedence to "meaning in use" over "formal meaning".

Windows performance analysis field guide

Microsoft home windows eight. 1 and home windows Server 2012 R2 are designed to be the simplest appearing working structures thus far, yet even the simplest structures should be crushed with load and/or plagued with poorly appearing code. home windows functionality research box consultant grants a pragmatic box advisor method of functionality tracking and research from specialists who do that paintings each day.

Introducing Microsoft System Center 2012 R2

Get a head commence comparing process middle 2012 R2 - with technical insights from a Microsoft MVP and individuals of the process heart product staff. This advisor introduces new positive factors and functions, with scenario-based suggestion on how the platform can meet the desires of what you are promoting. Get the high-level evaluation you want to commence getting ready your deployment now.

Additional info for Secrets of the JavaScript Ninja

Sample text

That means that we can use the jQuery function name continuously within our library while, externally, someone could've re-named the global jQuery object to something else. Since all of the functions and variables that are required by the library are nicely encapsulated it ends up giving the end user a lot of flexibility in how they wish to use it. However, that isn't the only way in which that type of definition could be done, here's another: Listing 3-22: An alternative means of putting a variable in the outer scope.

Only a single isPrime function exists and it completely encapsulates the original function, hidden within a closure. This final example is a good demonstration of obscuring original functionality via a closure. This can be particularly useful (from a development perspective) but can also be crippling: If you obscure too much of your code then it becomes unextendable, which can be undesirable. However, hooks for later modification often counter-act this. We'll discuss this matter in depth throughout the book.

Var id = setTimeout(fn, delay); - Initiates a single timer which will call the specified function after the delay. The function returns a unique ID with which the timer can be cancelled at a later time. var id = setInterval(fn, delay); - Similar to setTimeout but continually calls the function (with a delay every time) until it is cancelled. clearInterval(id);, clearTimout(id); - Accepts a timer ID (returned by either of the aforementioned functions) and stops the timer callback from occurring.

Download PDF sample

Rated 4.42 of 5 – based on 46 votes