Recent Web Log Entries By Ben Nadel
Cross-Origin Resource Sharing (CORS) AJAX Requests Between jQuery And Node.js
Posted: February 10, 2012 at 11:10 AM by Ben Nadel
After reading the REST API Design Rulebook by Mark Masse , I'm all jazzed up about API design! This recent enthusiasm has afforded me the motivation to attack a number of new topics all at the same time. If I'm going to be experimenting with API design, why not try it on an Amazon EC2 (Elastic Compute Cloud) Micro instance ? And if it's on EC2, ... read more »
Comments (1) | Post Comment | Ask Ben | Permalink
jQuery.whenSync() Plugin For Chaining Asynchronous Callbacks Using Deferred Objects
Posted: February 6, 2012 at 10:26 AM by Ben Nadel
Last week, I started to talk about chaining asynchronous Validation rules using jQuery Deferred objects . After writing up that post, I thought I might be able to factor-out the core idea into its own jQuery plugin - jQuery.whenSync(). Like the native jQuery.when() method, the jQuery.whenSync() method takes a variable-number of arguments; however... read more »
Comments (0) | Post Comment | Ask Ben | Permalink
ColdFusion Supports HTTP Verbs PUT And DELETE (As Well As GET And POST)
Posted: February 3, 2012 at 10:23 AM by Ben Nadel
Over the weekend, I read an excellent book on building RESTful web services - the REST API Design Rulebook by Mark Masse . In the book, Masse describes how the various HTTP methods (also known as Verbs) are intended to be used to create, access, update, delete, and augment data within a RESTful web service API. As far as HTTP verbs go, I'm extrem... read more »
Comments (6) | Post Comment | Ask Ben | Permalink
Use A Return Statement When Invoking Callbacks, Especially In A Guard Statement
Posted: February 1, 2012 at 10:09 AM by Ben Nadel
In a synchronous processing workflow, the Return statement tends to indicates the end of a given function's execution. In an asynchronous processing workflow, callbacks are more generally used to indicate the desired end of a given function's execution. That said, it is critical that a Return statement is also used in an asynchronous workflow in o... read more »
Comments (9) | Post Comment | Ask Ben | Permalink
Using jQuery Deferred To Chain Validation Rules In An Asynchronous, Non-Blocking Environment
Posted: January 31, 2012 at 10:34 AM by Ben Nadel
A while back, I blogged about how client-side validation is changing the structure of server-side validation ; with the client creating user-friendly error messages, the server can finally streamline its validation and data processing using a light-weight, exceptions-based workflow. While I really like this evolutionary step in data handling, I r... read more »
Comments (5) | Post Comment | Ask Ben | Permalink
How I Got Node.js Running On A Linux Micro Instance Using Amazon EC2
Posted: January 27, 2012 at 6:42 PM by Ben Nadel
In the past, I've dabbled with Node.js (a server-side JavaScript runtime environment) on my local MacBook Pro. If you know JavaScript, it's not too hard to get something up and running on your local machine. Putting Node.js out into the wild, however, is whole other beast. Not only am I mediocre at managing web servers in general, I happen to kn... read more »
Comments (3) | Post Comment | Ask Ben | Permalink
Extending Classes In A Modular JavaScript Application Architecture Using RequireJS
Posted: January 26, 2012 at 10:25 AM by Ben Nadel
Yesterday, I tried to apply some deep thinking to how dependencies should be managed in a modular JavaScript application architecture that is using RequireJS . The conclusion that I came to was that RequireJS should manage and load "definitions" while your application should manage and load "instances." This makes sense since instantiation is the... read more »
Comments (0) | Post Comment | Ask Ben | Permalink
Managed Dependencies vs. Dependency Injection In RequireJS
Posted: January 25, 2012 at 10:37 AM by Ben Nadel
In my journey towards understanding modular JavaScript application architecture, I've been using a lot of RequireJS . The RequireJS framework facilitates the organization and then the subsequent loading of individual JavaScript classes . When it comes to defining classes, RequireJS provides us with two opportunities for dependency loading: manag... read more »
Comments (8) | Post Comment | Ask Ben | Permalink
Creating A Keyboard-Shortcuts Module In A Modular JavaScript Application
Posted: January 23, 2012 at 11:03 AM by Ben Nadel
Last week, I looked at handling keyboard shortcuts in a modular JavaScript application architecture . In that initial exploration, I distributed the handling of keyboard shortcuts across two different modules: a Controller module and the View module that would ultimately be affected by the command. After I was done with the code, however, I was l... read more »
Comments (7) | Post Comment | Ask Ben | Permalink
Handling Keyboard Shortcuts Within Modular JavaScript Application Architecture
Posted: January 20, 2012 at 4:40 PM by Ben Nadel
Yesterday, when using Gmail, I started to think about keyboard shortcuts. Specifically, I started to think about how keyboard shortcuts get routed within a modular JavaScript application architecture. If I have a module that can respond to the keyboard - but, that module is not supposed to "know" about the document at large - how does it listen fo... read more »
Comments (1) | Post Comment | Ask Ben | Permalink
Using An IFrame To Override document.write() Inside A DOM (Document Object Model) Sandbox
Posted: January 19, 2012 at 10:49 AM by Ben Nadel
Last week, I talked about loading GitHub Gist content after the DOM (Document Object Model) had loaded . This was a somewhat complex operation since the remote Gist Script tag uses document.write() in order to inject the Gist content into the calling document. If document.write() is called after the parent document has been "closed," the write() ... read more »
Comments (2) | Post Comment | Ask Ben | Permalink
Trying To Mimic LET Functionality In JavaScript Using Self-Executing Functions
Posted: January 17, 2012 at 10:31 AM by Ben Nadel
Last night, I was listening to the Lately In JavaScript podcast . Among the many items discussed, one topic that was brought up was the emergence of the LET keyword in the next version of ECMAScript (the language on which JavaScript is based). LET allows for block-level variable binding; so, while the VAR keyword allows for function-level variabl... read more »
Comments (2) | Post Comment | Ask Ben | Permalink
Experimenting With GitHub Gist-Based Code Samples For My Blog
Posted: January 16, 2012 at 10:25 AM by Ben Nadel
Last week, I started looking around for a new color-coding solution for my blog's syntax highlighting. For the past couple of years, I've been using my own home-grown algorithm; which worked well for ColdFusion but, quite poorly for everything else. After looking at some of the options out there, I settling on trying to integrate GitHub's Gist hos... read more »
Comments (7) | Post Comment | Ask Ben | Permalink
Loading GitHub Gists After The Page Content Has Loaded
Posted: January 13, 2012 at 10:54 AM by Ben Nadel
A long time ago, I created a syntax highlighter / color-coder for my blog post code snippets. It was a pain to create; but in the end, it worked pretty well. For ColdFusion code. That was tag based. In recent years, however, I've tried to branch out a bit, playing with other languages, JavaScript in particular. For these languages, my color coding... read more »
Comments (11) | Post Comment | Ask Ben | Permalink
Using jQuery Deferred To Create Compound Objects From Multiple Asynchronous Data Sources
Posted: January 11, 2012 at 11:02 AM by Ben Nadel
As of now, all of my experimentation with modular JavaScript application architecture has been exclusive to client-side code. That is, it involves Views and Controllers, but no real sense of any Model that is tied to a persistent data store. As I've started to think about experimenting with the Model facet of client-side MVC (Model-View-Controll... read more »



