August 3rd in Widget by . no comment .

JavaScript Widget Development Best Practices (Part 6: Refactoring the Widget API)

In the former article of the series We rendered the user interface of our widget inside an anchor element in publisher’s website; We asynchronously loaded widget styles; We implemented a very naive authentication mechanism. We also defined a job queue _wdq (similar to google analytics’ _gaq) to be able to …

Continue Reading
July 16th in Widget by . no comment .

JavaScript Widget Development Best Practices (Part 2: the Setup)

In the former part of the series we had a brief introduction on challenges in developing JavaScript widgets. In this article, we’re going to continue from where we left: We will start by installing necessary instruments to develop and test our code. First Things First Before we start actual coding, …

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
June 4th in PhoneGap by . 2 comments .

Creating A Mobile JavaScript Chat – Part 4: Cross-Domain Restrictions

In the former tutorial of this series, we created a sample mobile application that’ll run in an Android mobile device. All the HTML, CSS and JavaScript files, which the application was using, were stored in the /assets/www folder of our mobile project. You can click here, to get the source …

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
April 25th in o2.js Modules by . no comment .

Update on “o2.Debugger”

I’ve updated the o2.Debugger object to adhere the module pattern that we’ve discussed before. You can click here, to get the source code (1.44K zipped archive) »» The updated source code is as follows: //create an o2 namespace if not alraedy created if(typeof o2 == 'undefined'){var o2={};} /** * o2.Debugger …

Continue Reading
April 24th in Module, Patterns and Practices, Tutorial by . 4 comments .

The JavaScript Module Pattern

Introduction Module Pattern is excellent for encapsulating component-specific knowledge. It was first coined by Eric Miraglia, years ago at Yahoo! User Interface Blog. Especially when developing external widgets to sites, this pattern is a good candidate, because your widget’s logic will be encapsulated inside a closure, and it will not …

Continue Reading
o2.js _
Fork Ribbon