Create Apps using JavaScript and Ajax

Use the same ubiquitous set of languages you find in the Web browser, on the server to build full apps or presentation tiers faster and more easily.

HTML, JavaScript, and CSS are all native to Jaxer, as are XMLHttpRequests, JSON, and DOM scripting. And as a server it offers access to databases, files, and networking, as well as logging, process management, scalability, security, integration APIs, and extensibility.

Jaxer is licensed under the GPL, and leverages the ubiquitous Mozilla engine that is used in Firefox 3, which means that Jaxer is fully compatible with the latest JavaScript standards, including access to all of the features you are familiar with – from Date to Math to window and document, and even JavaScript 1.5, 1.7, and 1.8 – they’re all there. If you know JavaScript and HTML, you can already build Jaxer applications.

Database, file, and socket access from JavaScript

With Jaxer, your JavaScript gains full access to databases such as MySQL or the integrated SQLite database. Rich filesystem I/O as well as low-level network socket access are available to you all directly in JavaScript on the server. And you can call those server functions seamlessly from the client – exposing only the ones consistent with your security requirements.

Share validation code on the browser and server

With Jaxer, you can also tag any function or block of functions to run on both the server and the browser. Developers can write logic once, and it can be executed from either location. One ideal use of this is data validation. Validate your forms on the client to provide instant user feedback, and once the form is successfully submitted, validate it again on the server to ensure its integrity, using the exact same logic – no more code rewriting, and no getting them out of sync and possibly opening security holes.

Easily create RESTful JSON data services

Not surprisingly, JSON is native to Jaxer, so creating RESTful JSON services to provide data to Ajax, Adobe Flash, Adobe Flex and even Microsoft Silverlight clients is dead easy.

Easily create RESTful JSON data services

Not surprisingly, JSON is native to Jaxer, so creating RESTful JSON services to provide data to Ajax, Adobe Flash, Adobe Flex and even Microsoft Silverlight clients is dead easy.

Full DOM and JavaScript on the server

Because Jaxer is a full Ajax server, you can not only run JavaScript on the server using the same techniques you’ve mastered in the browser, but you can also manipulate the DOM in the APIs you already use.

Use your favorite Ajax libraries server-side

Run jQuery, dojo, Ext JS, prototype, scriptaculous and other Ajax libraries on Jaxer to manipulate the HTML page and DOM before the page gets sent to the browser and those libraries can be used again. Customize content or forms server-side based on user profiles, optimize app performance by aggregating external scripts, CSS, and even images into single HTTP requests, generate pages optimized for devices that do not support Ajax, or flatten pages for search engine optimizations.

Manipulate, mashup and morph any existing HTML page

Consume and transform content from HTML pages written in other languages like PHP, Python, Ruby on Rails, .NET or Java. Jaxer includes a rich framework for many useful tasks on the server, including accessing local or remote web resources and services without cross-domain security restrictions that a browser might impose, or rewriting HTML pages generated by other platforms.

A Browser’s Engine Running on the Server

Jaxer’s core engine is based on the same Mozilla engine that you’ll find in the popular Mozilla Firefox browser. This means that the execution environment you use on both the client and the server are the same. It’s Ajax all the way through and through. That means you only need one set of languages — the languages that are native to the browser — to create entire applications.

Read on for a short summary of how Jaxer works, or go deep in this Jaxer Architectural Overview.

Lifecycle of a HTML page with Jaxer

  • Step 1. Jaxer executes the JavaScript functions that are set to runat=”server” or runat=”both”. These functions might call databases, file systems, communicate across network sockets, or get session data. And since the server-side engine has a HTML document object model (DOM) just like the browser, the HTML page can be manipulated through standard DOM APIs and your favorite Ajax libraries. Jaxer also has session objects that you can use to persist data for users during a session or transaction. Any functions set to runat=”server” are stripped from what gets sent to the browser.
  • Step 2. After Jaxer sends the resulting HTML page to the browser, the browser interprets the page and executes the JavaScript within it. If you included JavaScript functions tagged to runat=”server-proxy”, then Jaxer automatically strips out the bodies of those functions and replaces it with a new functions by the same name that know how to invoke the original function on the server using Ajax calls and return the result either synchronously or asynchronously. Best of all you need not write any Ajax communications yourself. This is all done for you. Any functions not tagged with a runat attribute or set to runat=”client” or runat=”both” are processed by the browser.
    Step 3. Any functions you set to runat=”server-proxy” can now be called from the client. All you do is call the function as if it were running on the client, and Jaxer, automatically via XHR communications with the server, marshalls the parameters to the server where the function executes (calling databases, getting info from the session data, etc…) and returns the result to the browser. To make Jaxer the ultimate in ease, you can invoke these “server-proxy” functions either synchronously or asynchronously.

A whole app in a HTML page?

By default Jaxer processes .html files on the server before sending them on to the server. You can configure Jaxer to process other files extensions as well, or even set Jaxer up to provide RESTful JSON services to other apps — even non-Ajax apps. This means that you could create a whole app in a single HTML page if you wanted, though multiple files is still the best practice for more extensive applications and team development processes.

Jaxer performs in the range of PHP and Ruby on Rails

Jaxer 1.0 is ready for full-scale application deployments and while our plans are to continue to boost performance with each release, initial studies show that Jaxer performs in the range of the widely used PHP and Ruby on Rails application platforms.