December 4th in Code Organization Guidelines by . no comment .

How to Refactor a Mess into an Organized Web Application (Part 0: Teaser)

Ever found yourself as the front-end coder of a fat-client project, where the project has the following characteristics: The project has been going on for over for serveral years, The JavaScript is spread all over the place (I mean “all” over the place; inline, inside php snippets, within templates… here, …

Continue Reading
November 5th in Functional Programming by . no comment .

Everything You Need To Know About JavaScript Functions (and more)

Functions are the building blocks of any JavaScript module. In this tutorial, we’ll have a glance on basic principles behind functional programming in JavaScript, along with some lesser known features of JavaScript functions. This is mainly a follow-up, and a more in-depth analysis, of a former JavaScript Function Kung-Fu post. …

Continue Reading
October 16th in Isolated Objects by . 1 comment .

A Little Known Encapsulation Technique in JavaScript: Isolated Objects

There’s not a single post in the blog that I’ve not mentioned or used the module pattern. The module pattern is really useful in encapsulating functions, objects, and static configuration constants; making them invisible and inaccessible outside the module‘s boundaries. Here’s a simple example, which we have elaborated in depth …

Continue Reading
May 29th in o2.js Modules by . no comment .

Cross-Domain AJAX Requests With JavaScript

We will soon finalize our Mobile JavaScript Application and convert it to an Android-market-ready .apk file. But before that we’ll need some enhancements to our o2.Jsonp object. o2.Jsonp, which allows cross-domain communication using JSON with Padding, was first mentioned in this post. You can click here, to get the source …

Continue Reading
May 3rd in o2.js Modules by . no comment .

JavaScript Method Kung-Fu

Functions are powerful construct in JavaScript. In this tutorial, we are going to do some advanced function manipulations with. Do you like Reflection? Then you’ll love this tutorial

Continue Reading
April 27th in Basics, Tutorial by . no comment .

to Equal or not to Equal, That’s the Problem!

At the end of this tutorial, you’ll be able to explain why the following code produces the associated output below — where the assert function prints “FAIL:” if its first parameter is falsey, and “PASS:” if it’s first parameter is truthy, as described in this Factory Pattern post: This code… …

Continue Reading
April 26th in Basics, Tutorial by . no comment .

Functions and Closures in JavaScript

How to Declare a Function There are various ways to declare a JavaScript function: You can either declare with a function statement or with an anonymous function expression or by using a named function. //declare a function function sample(){} //a function expression var functionExpression = function(){}; //a named function var …

Continue Reading
o2.js _
Fork Ribbon