Archive results for:

JavaScript Testing Presentation

Ryan Anklam from Netflix does a nice presentation at this years HTML5Dev Conference on how to test your JavaScript with some of the popular testing frameworks such as Jasmine, Mocha, QUnit and others.


JavaScript Tip: Scope

Here is a great presentation by David Aragon at the jQuery Conference 2013 in San Diego talking about Scope and JavaScript:


JavaScript Frameworks

headliners-plugins-172440_621x295As the industry continues to evolve, we’re beginning to see widespread adoption of a new methodology for providing highly responsive experiences on the web: SPAs, or single-page web applications.

While, in the past, an effort this ambitious would have required an overwhelming amount of code, luckily, thanks to various frameworks, the process is easier than it’s ever been.

The following tools will jump-start your process:

BackBone (http://backbonejs.org/)
Currently the reigning champ of JavaScript frameworks (at least, in terms of popularity), Backbone provides structure for your sloppy spaghetti jQuery code. Though it may require a bit of rethinking, when it comes to your understanding of a client-side MVC  framework (especially, if you’re coming from a server-side framework), once you fully grasp the essentials you’ll find yourself writing clean, modular, downright elegant code. Read more ›


Learning JavaScript Intro Class

Javascript A self-study class ($25) enabling students to learn at their own pace includes seven lessons guiding you through the foundation of modern programming practices on the client browser using JavaScript.

This introduction JavaScript class will take the novice with no programming experience at all get up to speed on how JavaScript can quietly be used with HTML and CSS to really make your pages standout. Today’s JavaScript is not about opening popup windows, browser detection, mouse-rollovers and the like, but is understanding how to allow your content layer (“HTML”) and presentation layer (“CSS”) to work seamlessly and unobtrusively with your behavior layer (“JavaScript”). Read more ›


Javascript Tip: Avoid Global Variables

Creating globals is considered a bad practice in general and is specifically problematic in a team development environment. Globals create a number of nontrivial maintenance issues for code going forward. The more globals, the greater the possibility that errors will be introduced due to the increasing likelihood of a few common problems.

The potential for naming collisions increases as the number of global variables and functions increase in a script, as do the chances that you’ll use an already declared variable accidentally. The easiest code to maintain is code in which all of its variables are defined locally.

The global environment is where native JavaScript objects are defined, and by adding your own names into that scope, you run the risk of picking a name that might be provided natively by the browser later on.

Ensuring that your functions don’t rely on globals improves the testability of your code. Read more ›


JavaScript Tip: Console.log

In JavaScript development, a very useful method for finding out the details about a JavaScript item (variable, object, property, etc) you have, is the console.log() method. This allows you to place things in the console rather than somewhere on your page (like using an alert() method).

Browser Support

  •   Chrome, Safari, Opera: native console.log()
  •   Firefox: native console.log() with Firebug
  •   IE9: native console.log(), but it needs Develop Tools to be turned on first.
  •   IE8: Do not bother, use Firebug Lite instead.

JavaScript Tip: Event Registration

JavaScript normally runs code sequentially, which means in the order that the browser reads it from your file, but we can write JavaScript code that will run only when something happens in the browser. That’s because browsers can trigger events, when things happen to elements on your page.

When the page loads in a browser, when the user moves the mouse over a link, when a video has finished loading, or when a form is submitted are events. So if you want to take care of a task when something happens you have to capture that event, and that’s done through a process called event registration.

This means telling the browser that you want to do something when an event takes place, and there’s several ways of doing that. Some are more compatible with older browsers than others.

The first (but legacy) way of doing this is by using tag attributes, and this works pretty simply.

Read more ›


Page 1 of 4123...Last »