In my previous article I showed the differences between scope and context, basic problems that arise and how to fix them. If you are just using some JavaScript and maybe jQuery, an understanding of scope is all that is needed to get you by. Once you start using objects or namespaces however, you’ll start to run into issues with context and will need to use the keyword this. But when you get into object oriented JavaScript, you’ll need an advanced understanding of context and how to make it work for you. To do this, we’ll use the call() and apply() methods, and then a backwards compatible version of the new feature Mozilla recently released in JavaScript 1.8.5 called bind().

(more…)
Archive for the ‘AJAX’ Category
JavaScript Context, Call and Bind – Ninja Level
Monday, December 5th, 2011JavaScript Scope and Context – Not the Same Thing!
Tuesday, November 29th, 2011In forums and other places I often see people incorrectly use the term scope when they should be using the term context. Scope applies to the variable and functional access of a function, whereas context is the property and method access of a function. Essentially, scope is function-based, and context is object-based.

(more…)
Building Web Applications with MDV
Wednesday, November 2nd, 2011MDV or “model-driven views”, eschews the concept of widgets in favor of template-based views which are behavior-based and update themselves when the data has changed.
Max Motovilov gave a presentation on MDV which was enlightening and thought provoking. He showed how he leveraged The Dojo Toolkit to create behaviors and data stores which update his views through his custom-built template system.
Max’s detailed presentation can be seen here, and you can also see the examples he used on GitHub.
Google Dart – Should JavaScript be Replaced?
Tuesday, September 27th, 2011A memo from a Google employee was leaked earlier this month exposing the new plan for Dart, which they claim to be a new programming language for structured web programming. The memo goes into some detail on what Dart would be, but doesn’t go into much detail on why Dart should be. In other words, it doesn’t explicitly state the deficiencies in JavaScript. Do they have a point? Should JavaScript be replaced?
Simple and Easy JavaScript Inheritance
Tuesday, June 14th, 2011For object inheritance, I had been using the traditional method of assigning methods and properties to the function’s prototype. Because my project was relatively simple, I could get away with this for a while. But as the project grew in scope, using the prototype started proving unwieldy. It worked, but the code was getting messy and hard to read. I decided it was time to implement an inheritance system. Not too complex, just something to help me organize my code. I ended up creating what I call my Declare Inheritance Helper.

(more…)
Brendan Eich Redesigns JavaScript to Look Like jQuery
Friday, April 1st, 2011
“Obviously, due to the success of jQuery and the lack of base-knowledge of JavaScript”, Brendan explained at a recent gathering, “JavaScript is a huge failure. I’ve redesigned it to look like jQuery, and will implement it, retroactively, into the web.” (more…)
HTML5 is Dead
Thursday, January 20th, 2011
You read that right. One day after the W3C’s earth-shaking announcement to brand HTML5 with a new logo… The WHATWG announces that HTML5 will no longer exist. Hey, Ian Hickson says that the WHATWG works closely with the W3C — but now I have to wonder. (more…)
HTML5 Grows up and gets a Logo
Tuesday, January 18th, 2011
The W3C revealed the new HTML5 logo designed by Ocupop, a design firm in Hawaii that looks to me listens to too much Jack Johnson… (more…)
Video: Ajax News January 2011
Friday, January 14th, 2011He’ll make you laugh… he’ll make you cry. Bob delivers AJAX News.
Video: How to Build Web Apps
Monday, January 10th, 2011A new video is posted from the January 4th 2011 Club AJAX meeting. Basic and advanced code for Ajax apps. The main subjects covered were CSS organizing, and OO-CSS concepts, and an HTML5 Video Player with custom JavaScript.




