Download OJ


ojoj.min.js (0.3.4)oj.js (0.3.4)docs

Download Plugins



YouTubeVideooj.YouTubeVideo.min.jsoj.YouTubeVideo.jsdocs
VimeoVideooj.VimeoVideo.min.jsoj.VimeoVideo.jsdocs
JSFiddleoj.JSFiddle.min.jsoj.JSFiddle.jsdocs
GitHubButtonoj.GitHubButton.min.jsoj.GitHubButton.jsdocs
TwitterButtonoj.TwitterButton.min.jsoj.TwitterButton.jsdocs
AceEditoroj.AceEditor.min.jsoj.AceEditor.jsdocs
markdownoj.markdown.min.jsoj.markdown.jsdocs
mustacheoj.mustache.min.jsoj.mustache.jsdocs

Examples

All examples are included in the oj-examples project. To take a look at them clone the repository with git:

git clone git@github.com:ojjs/oj-examples.git

Or just go there directly:

View all examples

The goal of these is to get you started as fast as possible. If these don't work immediately let me know and I'll fix them so they are even more clear.

Client-side Hello World

Getting started with OJ is as simple as including oj.js and executing code. Here is Hello World in JSFiddle:

View source (github.com)

View example (ojjs.org)

Client-side with Backbone

To get started with model binding with Backbone check out this example:

View source (github.com)

View example (ojjs.org)

Server-side Commandline

View source (github.com)

View example (ojjs.org)

Server-side Commandline (in CoffeeScript)

View source (github.com)

View example (ojjs.org)

Server-side with Express

Important: Express support isn't implemented yet. This is my #1 priority after this documentation push.

For those wondering why it doesn't exist yet: the challenge is that serious caching is necessary for minification and require traversal. A simple "one function" approach would be pretty trivial. It is just getting support the command-line tool's file unification and minification that is hard.

If you are an expert on Express middleware integration, please feel free to reach out.