Just another weblog

Archive for the ‘java script’ Category

Visual Event

Posted by damuchinni on March 13, 2009

This is a really neat tool by Allan Jardine, a UI developer! It makes it so easy and visual to see what even handlers are attached to the elements of a page. Great addition to my toolbox!

When working with events in Javascript, it is often easy to loose track of what events are subscribed where. This is particularly true if you are using a large number of events, which is typical in a modern interface employing progressive enhancement. Javascript libraries also add another degree of complexity to listeners from a technical point of view, while from a developers point of view they of course can make life much easier! But when things go wrong it can be difficult to trace down why this might be.
Read the whole article about Visual Event


Posted in java script | Tagged: , | Leave a Comment »

Latest Upgrade: X2O for JavaScript

Posted by damuchinni on March 7, 2009

Over the last couple of months, we’ve worked on extending X2O to generate a JavaScript library alongside the generated AS3 SWC file for each project. Today, we’re launching it as part of our beta release. This library will be automatically available the next time you generate an X2O project.

While currently undocumented (we’ll be getting to that in the coming weeks), the JavaScript library follows very closely to the documented AS3 library. One main difference is that all the JavaScript classes reside under a single namespace (X2O). While we don’t have documentation, we do have a sample application at View the source code to see how we’ve implemented the generated JS library. This replicates the Flex-based sample recipe application found at and uses the same data model that comes with your existing X2O accounts.

The JS version still has a few issues. Specifically, we’d like to improve its security and performance. We’d love for any JS developers to give us feedback on how we can improve the generated codebase.

The small things…
Besides that, we’ve done a number of small things to improve some nagging issues with the system. Among other things, the X2O client is now working for IE8 users and the periodic hanging some of you experienced with the login()method should now be resolved. We’d like to thank those of you that contacted us with your problems and keep them coming!

Thanks again for your continued support of X2O!

Posted in java script | Tagged: | Leave a Comment »

JavaScript as Byte Code – C#, Java, etc to JavaScript Compilers and Cross-Compilers

Posted by damuchinni on March 7, 2009

HTML is great for document layout. Its fast, clean and everyone knows it. Sprinkle a bit of JavaScript on that, and you have a nice interactive document. But HTML was never designed to be the basis for an application platform, and really is a pretty poor application platform. But despite the features of other platforms, and the number of times HTML and JavaScript is pronounced dead, something breaths life back into it.

It started with FireFox, and continued on with the awefully impressive Google Maps. Google has a large interest in keeping the browser alive and relevant. The longer it does so, the longer it has a platform on which to compete with Microsoft that is already deployed to 99% of the world’s user base. A “Google Flash” may not be feasible, because of the deployment nightmare involved, but as HTML evolves with offline capabilities, richer CSS and faster JavaScript engines (see Google Chrome), it becomes a platform that can largely compete with the rest.

And for this reason, Google has cleverly turned the browser into their own RIA platform. The “Google Virtual Machine”, as you may call it. To do this, they’ve leveraged the existing tools that Java has to offer, and created Google Web Toolkit – a Java compiler that can compile Java into cross-browser JavaScript. And on the client side, they’ve added Google Chrome. You can easily consider Google Web Toolkit and Google Chrome to be a full RIA platform, with JavaScript as the byte code transport. And not only that, but its an RIA platform fully backwards compatible with the existing deployed base of browsers.

Perhaps the most interesting thing is that Google Web Toolkit is not the only JS or cross-compiler. A variety for compilers have been built for this purpose. Microsoft Research has Script#, which compiles C# to JavaScript, and a bunch of projects use JSC, a cross compiler that compiles MSIL into JavaScript (and therefore any .NET language). With a whole variety of tools out there by different vendors to compile to JavaScript, it appears that JavaScript has become the new universal byte code. It can be processed by a whole variety of browsers, and produced by a variety of tools – one of the only computing platforms that that is true for.

And compiled JavaScript can also be pretty fast and make applications that are rich and look good. While it doesn’t compare to the offerings of Cocoa, WPF or Silverlight, the quality of application that can be achieved is good enough for most consumers. In the case of GWT, it is not only fast, but also efficient – and best of all, code can be shared amongst client and server.

I don’t like HTML as an application platform, and I am not very fond of running every application inside the browser chrome. But as business strategy and deployability have become increasingly important to me in my recent venture, an RIA application based around the native browser has become my platform of choice. Cross compilation, in my experience, has proven an effective way to make a very rich client that can even handle push-data.

Posted in Java, java script | Tagged: , | 1 Comment »