By Ivan StorckNovember 8, 2013

Write web pages in one language instead of three

The typical work-flow of editing three separate files is clunky – three files, in three separate syntaxes: HTML /CSS / and JavaScript.

Developers are creating extensions to HTML and CSS to turn them into programming languages. For example HAML / ERB / Sass SCSS. However, we already have a fully capable language in the browser: JavaScript.

How we create web pages is not aligned with best practices in Object Oriented Design. Enter OJJS, a JavaScript View library that offers both DOM manipulation client-side and HTML and CSS creation server-side.

Three main features of OJJS:

  1. Currently, when making a website you have to keep in mind HTML, CSS, and JavaScript code. In OJ, all three parts are unified into objects. OJ can render to HTML and CSS as well as bind JavaScript events. You can use one approach to create and modify the page. This simplifies the process, reduces what you have to remember, and decreases your cognitive overload as a developer.

  2. The basic building blocks of the web are included in OJ. The library provides a series of tag functions, one for every tag (<div>, <span>, <ul>, <table>, <a>, etc.), to build up the structure of your site and help create the collection and form types you are using. The tag functions allow you to create HTML structure, CSS, and bind jQuery events simultaneously. These include creation and manipulation of the common elements like text boxes, text areas, drop-down menus, buttons, numbered lists, bullet lists, etc.

  3. OJ plugins provide advanced elements like YouTube and Vimeo embeds. You can create plugins for any other website or other web components on your site.

Have you worked with OJ, or want to learn more? Let us know @CodeFellowsOrg.