background preloader

Javascript

Facebook Twitter

JSHint, A JavaScript Code Quality Tool. Bob.js. JsPerf: JavaScript performance playground. Thomas Davis - Front end web developer. Working with Dates. Tutorial by Matt Doyle | Level: Intermediate | Published on 19 November 2002 Categories: This tutorial describes JavaScript's Date object, and shows how you can use it to manipulate dates.

Working with Dates

Also included is a simple script to display today's date on your web page. Very handy! JavaScript's Date object makes it easy to handle dates in JavaScript. In this tutorial we'll take a look at using the Date object, and end with a simple example script that displays the current date on the web page! The Date object The Date class is used to store and retrieve dates in JavaScript. New Date ( ) This creates a new Date object with the value of the current date and time on the browser PC.

X = new Date ( ); This creates a new Date object with the date value represented by the number of milliseconds since midnight on Jan 1, 1970. X = new Date ( 86400000 ); creates a new date object x with a date value of midnight, Jan 2, 1970. Better infinite scrolling with the HTML5 History API – Guillermo Esteves. Now that Piictu finally launched and is out of beta, I want to write a bit about one of my favorite things I worked on as the front-end web developer there, which is our implementation of an infinite scrolling page improved by the use of the HTML5 History API, the problem it tried to solve, and the solution we arrived at.

Better infinite scrolling with the HTML5 History API – Guillermo Esteves

What’s Piictu? A bit of background first. In case you haven’t tried it (and you totally should,) Piictu is an iPhone social photo app that revolves around the concept of “photo streams”, or threads of photos by different users on the same subject. For example, you can take a photo of a sandwich, start a stream titled “eating a sandwich”, and watch as your friends and followers reply with their own photos of their own sandwiches, or whatever they’re having for lunch. Check it out, there are some incredibly creative games and memes going on over there. The problem with infinite scroll. Working with Dates. Cdnjs - the missing cdn.

Require.js & AMD

Coffeescript. History.pushState. History.pushState -> location.hash -> query strings (no rewrites needed) - jsFiddle demo by cowboy. Intelligent State Handling · balupton/history.js Wiki. 9 Web workers. 10 Web workers 10.1 Introduction 10.1.1 Scope This section is non-normative.

9 Web workers

This specification defines an API for running scripts in the background independently of any user interface scripts. This allows for long-running scripts that are not interrupted by scripts that respond to clicks or other user interactions, and allows long tasks to be executed without yielding to keep the page responsive. Workers (as these background scripts are called herein) are relatively heavy-weight, and are not intended to be used in large numbers. Generally, workers are expected to be long-lived, have a high start-up performance cost, and a high per-instance memory cost.

Getting Started with Web Workers. One of the many design goals of the JavaScript language was to keep it single-threaded and, by extension, simple.

Getting Started with Web Workers

Though I must admit that, given the idiosyncrasies of the language constructs, it is anything but simple! But what we mean by being "single-threaded" is that there is only one thread of control in JavaScript; yes, sadly, your JavaScript engine can do only one thing at a time. Now, doesn't that sound too restrictive to make use of multi-core processors lying idle on your machine? SharedWorker pb. HTML5 Tech: Shared Web Workers Help Spread the News. After being a fixture in languages like Java for years, Web Workers have now made multi-threading in Web applications a reality.

HTML5 Tech: Shared Web Workers Help Spread the News

Right now, they are supported as of Opera 10.6, Safari 4.0, Chrome 11.0, Firefox 4.0 and are expected to be included in IE 10. I first wrote about them in an article entitled Introducing HTML 5 Web Workers: Bringing Multi-threading to JavaScript. In it, I spoke about dedicated Web Workers and covered the basics of their uses, limitations, as well as communication and error handling models. In today's follow up, we're going to move on to a different kind of Web Worker called a Shared Worker.

Performance

An Introduction to Handlebars. JavaScript Machine Learning and Neural Networks with Encog. Download heaton-javascript-ml.zip - 45.1 KB Introduction In this article you gain a basic understanding of how to use some Machine Learning topics in Javascript.

JavaScript Machine Learning and Neural Networks with Encog

I will use the Encog framework. I will show you how to use Encog objects to accomplish Optical Character Recognition, , Simulated Annealing, Genetic Algorithms, and Neural Networks. Encog also includes several GUI widgets that make it easy to display the output from common machine learning tasks. Using OpenLayers with GeoNames WebServices. Design patterns. Web Platform Team Blog. I like JavaScript.

Web Platform Team Blog

It is a language that is both powerful and flexible, but only if you know how to use it. Once you have mastered the JavaScript language you can build almost anything, and you can do so quickly and interactively. What They Didn’t Tell You About ES5′s Array Extras. Every new version of JavaScript adds some extra goodies that make programming easier.

What They Didn’t Tell You About ES5′s Array Extras

EcmaScript 5 added some much needed methods to the Array data type, and, while you can find resources which teach you how to use these methods, they typically omit a discussion on using them with anything other than a boring, custom function. All of the array extras ignore holes in arrays. The new array methods added in ES5 are usually referred to as Array Extras.

They ease the process of working with arrays by providing methods to perform common operations. Here is an almost complete list of the new methods: Categorizing values in JavaScript. In this article, I'll explain what kinds of values JavaScript has and how you can categorize them.

Categorizing values in JavaScript

That will help you better understand how the language works. It will also help you with advanced programming tasks, such as writing a library, where you often have to deal with all kinds of values being passed to you. With the knowledge gained here, you will be able to avoid bugs caused by subtle differences between values. I'll show you four ways in which values can be categorized: via the hidden property [[Class]], via the typeof operator, via the instanceof operator, and via the function Array.isArray(). JavaScript: Operators. In the previous article I talked about types and type coercion in JavaScript.

JavaScript: Operators

In this one I want to talk more about how this coercion applies to JavaScript operators. Lets go over six major operators and look at how they work: typeof The typeof operator returns a string representation of the type of the passed expression. It’s time to start using JavaScript strict mode. ECMAScript 5 introduced strict mode to JavaScript. The intent is to allow developers to opt-in to a “better” version of JavaScript, where some of the most common and egregious errors are handled differently. For a while, I was skeptical, especially with only one browser (Firefox) initially supporting strict mode.

Fast forward to today, every major browser supports strict mode in their latest version, including Internet Explorer 10 and Opera 12. Fully Understanding the this Keyword. Today's tutorial comes courtesy of the talented Cody Lindley, from his free ebook: JavaScript Enlightenment. He discusses the confusing this keyword, and the various ways to determine and set its value. Republished Tutorial. A plain english guide to JavaScript prototypes - Sebastian's Blog. When I first started learning about JavaScript object model my reaction was of horror and disbelief. I was totally puzzled by its prototype nature as it was my first encounter with a prototype based language.

I didn’t help that JavaScript has a unique take on prototypes as it adds the concept of function constructors. I bet that many of you have had similar experience. But as I used JavaScript more I didn’t just learn to understand its object model but also started love parts of it. Mozilla js reference. This chapter documents all of JavaScript's standard, built-in objects, including their methods and properties. The term "global objects" (or standard built-in objects) here is not to be confused with the global object. Here, global objects refer to objects in the global scope.

The global object itself can be accessed using the this operator in the global scope (but only if ECMAScript 5 strict mode is not used; in that case it returns undefined). In fact, the global scope consists of the properties of the global object, including inherited properties, if any. Other objects in the global scope are either created by the user script or provided by the host application. Value properties. Kriskowal/es5-shim. ECMAScript 5 « What the Head Said. Update, 10th July 2011 — It appears IE9 regressed this bug, so I updated the conditional compilation fix I wrote to work for all IE versions.

I prefer to use feature detection where available, but I don’t see this being feasible. The bug is still present as of IE 10 PP2, but the code could easily be adjusted to check for IE less than 10 if the problem is fixed again before the final release. I’ve been working on something lately that needs to check if a variable is an array. It’s a well known fact among JavaScript developers that, unfortunately, this is one of those situations where the typeof operator just doesn’t cut it. ECMAScript 5 Arrays. ECMAScript 5: Array methods. ECMAScript 5 extensions compatibility table. ECMAScript 5 compatibility table. A Few New Things Coming To JavaScript. Thoughts on ECMAScript 6 and new ... A critical review of ECMAScript 6 quasi-literals.

Quasi-literals (update: now formally called “template strings”) are a proposed addition to ECMAScript 6 designed to solve a whole host of problems. ECMAScript 6 collections, Part 2: Maps. Maps[1], like sets, are also a familiar topic for those coming from other languages. ECMAScript compatibility table. ECMAScript 6 collections, Part 1: Sets. Posted at September 25, 2012 07:00 am by Nicholas C.

Harmony of Dreams Come True. Yehuda Katz - ECMAScript 6. DOM Enlightenment. Dynamic Languages Strike Back. Does JavaScript need classes? Posted at October 16, 2012 07:00 am by Nicholas C. Blog » Blog Archive » Give your eval a name with //@ sourceURL. The Ins and Outs of Invalidation. Examplifier. Essential Javascript: the top five testing libraries. JS Minty Fresh. PhantomJS: Headless WebKit with JavaScript API.

JS graph libraries

jQuery UI Blog. Jquery/globalize. InstaLib - jQuery Instagram Library - imkreative. Useful JavaScript Libraries and jQuery Plugins For Web Developers. Parse, validate, manipulate, and display dates in javascript. Ded/reqwest. Postaljs/postal.js. Schteppe/cannon.js @ GitHub. Parallel.js: Parallel computing with Javascript. PhantomJS: Headless WebKit with JavaScript API. CanJS - Vimperator. Sweet.js. Try macros with sweet.js. AmplifyJS - A Component Library for jQuery. HATCHSHOW.js. Tutorial: JavaScript animation with the Greensock framework. Backbone and Ember. Knockout. Backbone.js. TodoMVC. Meteor. AngularJS — Superheroic JavaScript MVW Framework.

DataPrez - social data-visualization slide decks. BinaryMuse/ngInfiniteScroll.

Node.js