An introduction to Jaxer - the worlds first ajax server
I don't think many people have heard of Aptana's Jaxer. I only found it by pure chance, but once I started to read about it I was hooked. What a great idea - an ajax server that gives you the ability to write an entire ajax application in one language, Javascript.
Jaxer takes the power of the Mozilla engine, that's the engine that powers Firefox, and embeds it into a web server. This means that you can do do full javascript processing, using all of the DOM APIs that you would normally use on a browser, as well as Javascript libraries like jQuery and Dojo, directly on the server.
Jaxer operates as an output filter which means you can use it in conjunction with any existing server side processing you might already have (php, python etc). But once you get started with Jaxer you might realize that you have no need for the other languages. Jaxer comes with full support for accessing databases, filesystems and network sockets and really is a one-stop ajax solution.
<div id="myDiv"></div> <script runat"server"> myDiv.innerHTML = "The page was generated at:" + new Date(); </script>
Jaxer provides a special runat attribute for the standard html <script> tag. This allows you to specify where the contained code should run - at the client, on the server, or both. Ajax functionality can simply be embedded into a single page.
<script runat"server-proxy"> function getData() { Jaxer.DB.execute('SELECT * FROM NEWS'); } </script> <a onClick="alert(getData());">get news</a>
I've been using Jaxer for several months now and am very impressed with what it's capable of - I would highly recommend it for anybody looking to develop an ajax application. To get started with Jaxer I would recommend reading the following, all of which were a great help to me when I was first getting started:
- Jaxer project home page
Download Jaxer from the projects home page. - Getting Started with Jaxer in Aptana Studio
The official documentation has several example based learning exercises. - Javascript & MySQL With Jaxer
A great introduction with a complete step by step example to get you started.





15th Aug 2008, 5:58pm
"I don't think many people have heard of Aptana's Jaxer. I only found it by pure chance, but once I started to read about it I was hooked. What a great idea - an ajax server that gives you the ability to write an entire ajax application in one language, Javascript."
nice, except for the Javascript bit.
15th Aug 2008, 11:00pm
@ except for the JavaScript part? Have you been on the web lately? Heard the term Ajax? Ever use a Google gadget? What about Apple widgets on our desktop? Those use JavaScript too. This article by Mark Perkins is rather insightful on the ubiquity and continuously expanding use of JavaScript: How JavaScript is Quietly Taking Over the World http://blog.vgroup.com/post/how-javascript-is-quietly-taking-over-the-wo...
15th Aug 2008, 11:00pm
@hackman It still *sucks* hard as a language though. I wouldn't personally want to use it for server-side code but each to his own.
15th Aug 2008, 11:48pm
FWIW--More on JavaScript's future here:
http://ajaxian.com/archives/ecmascript-harmony-brendan-eich-douglas-croc...
20th Aug 2008, 12:09am
4th Nov 2008, 6:26pm
Your post left me wondering that why isn't jaxer being discussed/used widely.
Developers should be going crazy over this !!
Are there any down-side to this ?
5th Nov 2008, 5:23am
I think some people are reluctent to believe that JavaScript can actually offer a viable solution for server-side scripting because they believe that speed will be a major issue. However, if you look at the benchmarks on the Jaxer site, it stands up really well next to existing technologies such as PHP and Rails. Also, when JIT finally makes it into Firefox, that speed boost should be available to Jaxer running on the server too.
The few small bugs that I noticed in the beta phases have long since been ironed out.
5th Nov 2008, 8:14pm
Guess you are right... Like it was only after google used ajax that everyone started taking Javascript as a serious client-side scripting.
Lets wait and see when that sort of thing happens with Jaxer!
Post new comment