background preloader

ECMAScript 5 compatibility table

ECMAScript 5 compatibility table
Related:  javascript

YouTube Player API Reference for iframe Embeds - YouTube The IFrame player API lets you embed a YouTube video player on your website and control the player using JavaScript. Using the API's JavaScript functions, you can queue videos for playback; play, pause, or stop those videos; adjust the player volume; or retrieve information about the video being played. You can also add event listeners that will execute in response to certain player events, such as a player state change or a video playback quality change. This guide explains how to use the IFrame API. Requirements The user's browser must support the HTML5 postMessage feature. Embedded players must have a viewport that is at least 200px by 200px. Any web page that uses the IFrame API must also implement the following JavaScript function: onYouTubeIframeAPIReady – The API will call this function when the page has finished downloading the JavaScript for the player API, which enables you to then use the API on your page. Getting started <! <script> // 2. // 4. // 5. Loading a video player Events

Writing Fast JavaScript For Games & Interactive Applications - Game Programming Recent versions of JavaScript engines are designed to execute large bodies of code very fast but if you don't know how JavaScript engines work internally you could easily degrade your application's performance. It's specially true for games that need every drop of performance they can get. In this article I will try to explain some common optimization methods for JavaScript code that I picked up during development of my projects. One of the biggest problems in having a smooth experience resides in JavaScript garbage collector(GC) pauses. The problem arises when GC decides to clean up your objects: execution is paused, GC decides which objects are no longer needed and then releases them. Zig-zag memory usage pattern while playing a JavaScript game. To keep your framerate consistent, you should keep garbage creation as low as possible. var foo = {}; //Creates new anonymus objectvar bar = []; //Creates new array objectfunction(){} //Creates new function r.length = 0; Deleting Object Properties

JavaScript JavaScript is classified as a prototype-based scripting language with dynamic typing and first-class functions. This mix of features makes it a multi-paradigm language, supporting object-oriented,[6] imperative, and functional[1][7] programming styles. JavaScript has been standardized in the ECMAScript language specification. History[edit] Beginnings at Netscape[edit] JavaScript was originally developed by Brendan Eich, while working for Netscape Communications Corporation. Although it was developed under the name Mocha, the language was officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but it was renamed JavaScript[10] when it was deployed in the Netscape browser version 2.0B3.[11] The change of name from LiveScript to JavaScript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator web browser. Server-side JavaScript[edit] Adoption by Microsoft[edit] Standardization[edit] Trademark[edit]

JavaScript Tutorial JavaScript and the Netflix User Interface Web Development Alex Liu, Netflix In the two decades since its introduction, JavaScript has become the de facto official language of the Web. Despite its humble beginnings as a language intended to be Java's "silly little brother,"4 JavaScript eventually became a key component in enabling the Web 2.0 evolution. With increasingly more application logic being shifted to the browser, developers have begun to push the boundaries of what JavaScript was originally intended for. A/B Testing Netflix is steeped in a culture of A/B testing. While many of the A/B tests are launched in synchrony across multiple platforms and devices, they can also target specific devices (phones or tablets). A/B testing on the Netflix Web site tends to add new features or alter existing features to enhance the control experience. Facets to Features to Modules It is useful first to draw a clear line connecting the personalization facets and their impact on the UI. Dependency Management n! Future Optimizations

Lazy Loading Asyncronous Javascript – Friendly Bit Like many of you might know, I’m working on a site called Kundo with a couple of friends. It’s kinda like a Swedish version of Getsatisfaction, which means we have a javascript snippet that people add to their site to get feedback functionality. Cut-and-paste instead of writing the code yourself. The problem is, how do you load an external javascript with minimal impact on your customer’s sites? Small. Note: I did not make all of this up myself. Script tag While being the stand-alone, cross-browser, and the shortest piece of code possible; it doesn’t download asynchronously and doesn’t lazy load. Screenshot from Firebug’s net console: The script (set to load in 2 seconds) blocks the download of the big image (added after the above script tag, and used throughout this article as a test). Async pattern (A script tag written with javascript) Steve Souders, the web performance guru, has compiled a decision tree over different ways to achieve non-blocking downloads.

Closure Tools What is the Closure Compiler? The Closure Compiler is a tool for making JavaScript download and run faster. Instead of compiling from a source language to machine code, it compiles from JavaScript to better JavaScript. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what's left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls. How can I use the Closure Compiler? You can use the Closure Compiler as: An open source Java application that you can run from the command line. To get started with the compiler, see "How do I start" below. What are the benefits of using Closure Compiler? Efficiency.

Learn JavaScript: — JavaScript Scene There are so many JavaScript resources available out there, it’s hard to understand how much of it overlaps and how much is redundant. Not to mention the process of weeding out bad information. Most JavaScript learning resources neglect two of the most important topics in JavaScript: prototypal inheritance and functional programming. There are many possible paths, several good paths, but few great paths. Here is one clear path to JavaScript mastery: Why JavaScript? JavaScript is the standard language of the web platform. The essentials, in order: Newbie friendly: Make a Star Wars Game with Hour of Code (free website)Newbie friendly: “JavaScript for Cats”, Max Ogden (free website)Newbie friendly: FreeCodeCamp’s 10-hour Basic JavaScript track You can come back to FCC for more practice while you explore the rest of these resources. On ES6 On JavaScript Modules The largest package repository in the world (for any programming language) is npm. Favor Object Composition Over Class Inheritance