Connect NodeJS to Oracle--say what!?

posted by Ted on

I know what you're thinking--why would you want to use Oracle for your node backend when you have perfectly good options like mongo and the like? You know the old saying: "When in Rome, etc.". The business enterprise is quite likely Rome, and Rome likes its Oracle, baby.

My coding buddy Aaron Frost tamed this beast (to mix metaphors), so credit where it's due. I mostly watched and told him to use "sudo" in a couple of places. In this article we'll walk you through how he did it using one of two available drivers (as of ...

BusterJs with RequireJs/Backbone

posted by Jake on

BusterJs is a still-in-beta library that allows for testing your Javascript. It's got a wealth of cool features. The browser capturing is awesome for running your Javascript directly in the browsers you choose from one runner. You can also execute within Node. In short, it rocks. But, how to get this rockin' with your project, specifically your AMD RequireJs with BackboneJs combo project is the lock that must be opened before daily buster love can be had.

Dynamically Require Optimized Modules in RequireJs

posted by Jake on

Often when building a single-page app, you'll want to optimize all your js into a single asset. RequireJs is a great mechanism for managing your js dependencies. It also comes with a great build tool for doing the optimization (r.js). But sometimes you won't want to put all your js into a single asset. For instance, perhaps you only want to load a large chunk of code when the user interacts with the app so that you know he intends to use that functionality, and so you load it dynamically. But, you still want that dynamically-loaded set ...

Cross-Domain RequireJs Text

posted by Jake on

Through long-available browser quirks/features, javascript has been available for requests across disparate domains. But, other resources, such as text files (eg, handlebars templates) have had more restrictions placed on them. Recently, CORS support has enhanced the ability to make these requests. Here's how you get your text files from another domain via requirejs.

Handlebars For-Loop Index

posted by Jake on

HandlebarsJs is a great Javascript templating engine. It's pretty much Mustache templates on steriods -- or Rogaine or something like that. Well, there's a great for loop, but it'd be cool if it had a loop index built in. It doesn't have one as of the current version (1.0.0.beta.6). But, we can make an easy helper.

Intro to BackboneJs

posted by Jake on

BackboneJs is a great resource for creating rich UIs. Rich means interactive. Interactivity grows when the client can do more of the work of an application itself, becoming more reactive and dynamic to user feedback, able to be more event-driven, and hopefully more quick and responsive. Here's a short history of how we've been creating rich UIs and a simple example of a rich UI in backbonejs

PhantomJs meets Jasmine

posted by Bryan on

In developing a mobile web application, it would be ridiculous to avoid writing javascript unit tests. After all, they are simple to write and run. Recently, I implemented running our already existing Jasmine tests using PhantomJs and integrated this process into our continuous build environment. Works smooth!

Backbone Views in a Dynamic DOM

posted by Jake on

When you start writing applications with BackboneJS, that means that you're dealing with some dynamic UI. There are elements being pushed into and pulled out of the DOM. I was having problems trying to reference DOM elements that were dynamically inserted into the DOM by other Backbone views. The fix was simple but not immediately obvious without cracking open Backbone.

Backbone Inheritance

posted by Jake on

Backbone has a great inheritance mechanism. It's as easy as Backbone.Model.extend(). This much is obvious. Let's try a few other things, like: Subclassing our own classes, calling to super classes, adding subclass attributes, and adding various subclasses to a collection based on a super class.

I18n Strings in Javascript

posted by Jake on

I've seen a number of different ways that internationalized strings get put into Javascript code. Of all of them, I kind of like just bundling the resource bundle of key value pairs in Javascript files themselves, one for each language or something close to that. But, in a recent project, there were a few other constraints, so we did it another way.

Writing Jquery Plugins

posted by Jake on

Jquery has made developing javascript fun and enjoyable. It is a fantastic library that essentially allows the creation of library extensions on top of it via plugins. Jquery plugins are surprisingly easy to write and elegant to read and use. Here are a few tips on where to find good plugin candidates, design principles for plugins, and an outline of the basic structure that I have found most useful when writing plugins.

Submitting a form from an a href link using jquery

posted by Ted on

Okay, Okay, I admit it. I'm javascript challanged. As a Java developer, I've looked down my nose at paltry javascript, treating it as a "me-too" technology trying to cash in on the hype surrounding java all these years.
As a result, I've missed out on a lot of js goodies. And, with javascript entering a renaissance of sorts, combined with the wildfire-like buzz surrounding libraries such as jquery, it's high time I learn some.

Jquery Plugin: safesubmit

posted by Jake on

Jquery gives a great, easy-to-use mechanism for extending its API and creating your own plugins. For stuff that looks like it could be useful generally, you should really try to put it into a nice little plugin package. For submit buttons, there is a general thought that they shouldn't be clicked twice (especially for functions such as financial transactions), so I created a plugin that fits an app that I have been working on recently, where there are many, many submit buttons, saving very granual pieces of content through ajax requests.