ALL


  The Basics of jQuery

So, a while back I had an internal presentation at work about this topic. A few good friends in the community took a look at my slides, and they thought it would make a nice blog post because “there can’t be too many good posts about jQuery introduction and best-practices.” Whether this post is going to be good or not, is up to you but I’ll try to outline what jQuery is, and how you can start working with it.For most of you, this will just be a re-cap and probably not provide much new information but can perhaps serve as a reference post if you ever need one. I will e...

2,938 0       JAVASCRIPT JQUERY FRAMEWORK BASIC


  Prototypes and Inheritance in JavaScript

Forget everything you know about object-oriented programming. Instead, I want you to think about race cars. Yes – race cars. Recently I was watching the 24 Hours of Le Mans –a popular racing event in France. The fastest cars in the race are the Le Mans Prototypes. Although these cars are built by car manufacturers like Audi and Peugeot, they are not cars you’ll see on the streets and highways of your home town. They are built exclusively for high-speed endurance racing.Manufacturers put an enormous amount of money into researching, engineering, and building these prot...

6,019 0       PROTOTYPE JAVASCRIPT INHERITANCE


  A Javascript When Function

function when(conditionFunc, execFunc, interval){ if (conditionFunc()){ execFunc(); }else{ setTimeout(function(){ when(conditionFunc, execFunc, interval);}, interval); }}You have some code which should only execute when a condition is true. E.g. You have code which relies on a javascript library but can't be sure the library has loaded yet and don't want the code to execute until it has. This is common if you have a bookmarklet which injects more than one <script> tag or you have code which should only execute when an image or other asynchronously loaded element is...

3,747 0       JAVASCRIPT IMPLEMENTATION WHEN WHEN FUNCTION


  Valid JavaScript variable names

Did you know var π = Math.PI; is syntactically valid JavaScript? I thought this was pretty cool, so I decided to look into which Unicode glyphs are allowed in JavaScript variable names, or identifiers as the ECMAScript specification calls them. Reserved words The ECMAScript 5.1 spec says: An Identifier is an IdentifierName that is not a ReservedWord. The spec describes four groups of reserved words: keywords, future reserved words, null literals and boolean literals. Keywords are tokens that have special meaning in JavaScript: break, case, catch, continue, debugger,...

9,120 0       JAVASCRIPT STANDARD NAME CONVENTION


  Learn from Haskell - Functional, Reusable JavaScript

Learn You a Haskell: For Great Good?For the last couple months I have been learning Haskell. Because there are so many unfamiliar concepts, it feels like learning to program all over again. At i.TV, we write a lot of JavaScript (node.js and front end). While many functional/haskell paradigms don’t translate, there are a few techniques that JS can benefit from. There are Haskell library functions for everything. At first I thought this was just because it was mature, but then I noticed that these functions could be applied to a wider variety of problems than in other languages. This make...

2,293 0       JAVASCRIPT FEATURE HASKELL FUNCTIONAL REUSABILITY


  Avoiding and exploiting JavaScript's warts

One's sentiment toward JavaScript flips betweenelegance and disgust without transitingintermediate states.The key to seeing JavaScript as elegant is understandingits warts, and knowing how to avoid, work around or even exploit them.I adopted this avoid/fix/exploit approach after readingDoug Crockford'sJavaScript: The Good Parts:Doug has a slightly different and more elaborate take on the bad partsand awful parts,so I'm sharing my perspective on the four issues that have caused me the most griefin the past:how to fix broken block scope with with;the four (not three!) meanings of this;promoting ...

2,660 0       JAVASCRIPT VARIABLE THIS WARTS EXPLOIT WITH


  The Future of JavaScript � take a peek today!

The ECMA committee is working hard on designing the next version of JavaScript, also known as "Harmony". It is due by the end of next year and it is going to be the most comprehensive upgrade in the history of this language. Chrome and V8 are committed to pushing JavaScript forward and have already started implementing the new features. You can try some of them today in the latest dev channel release. Here’s a summary: Lexical scoping. Now "let" is the new "var" – traditional "var" declarations are complemented with "let" and "const". Both are properly block-scoped bindings, elimi...

3,823 0       JAVASCRIPT FUTURE FEATURE


  A re-introduction to JavaScript

IntroductionWhy a re-introduction? Because JavaScript has a reasonable claim to being the world's most misunderstood programming language. While often derided as a toy, beneath its deceptive simplicity lie some powerful language features. 2005 saw the launch of a number of high-profile JavaScript applications, showing that deeper knowledge of this technology is an important skill for any web developer.It's useful to start with an idea of the language's history. JavaScript was created in 1995 by Brendan Eich, an engineer at Netscape, and first released with Netscape 2 early in 1996. It was orig...

2,327 0       JAVASCRIPT OOP ARRAY TYPES RE-INTRODUCTION