MENLO PARK, Calif. — You know all that AJAX code you’ve been writing and tearing your hair out over as you attempt to get the JavaScript working in both Internet Explorer and Firefox? Yeah, that AJAX code It’s all going to be useless real soon. Sun Microsystems gave journalists a sneak peak at a new scripting language, JavaFX, which it will introduce at the annual JavaOne show in San Francisco today. JavaFX is a new extension to the Java platform that promises a consistent experience from desktop to handheld devices. The language offers interactivity, animation and programming consistent with AJAX, Adobe’s Flash and Microsoft’s new Silverlight technology, but employs the Java runtimes installed on your local client instead of clumsy JavaScript. JavaFX will ultimately be an entire product family. One of the first products will be JavaFX Script, which is designed for content authoring of Web and network-facing applications. “Most scripting languages are oriented at banging out Web pages. This is oriented around interfaces that are highly animated,” said James Gosling, Sun Fellow and the developer of the Java language. Added Rich Green, executive vice president of software at Sun JavaFX will also trigger desktop integration of over-the-wire applications with Java, rather than relying on a constant connection for the JavaScript used in AJAX. There are more perks with JavaFX, Sun officials claim. One of the knocks on AJAX applications, aside from browser compatibility, is that it requires a large amount of JavaScript to be sent over the wire; that script could have something malicious embedded in it. JavaFX eliminates that need by using the locally installed Java SE files. Only one new library needs to be installed along with the Java SE or ME installation, depending on the device. So instead of relying on the browser to sandbox off JavaScript code, the applications use the security features in Java SE to control an application’s hard drive access. Because it runs on the client and is not dependent on code sent over the wire, it also means applications written in AJAX, such as Google Apps, can be used offline. That will give Sun a big advantage, said Jeffrey Hammond, senior analyst for Forrester Research. “Disconnected use is the next major battle here,” Hammond told internetnews.com. “Some commercial AJAX providers are moving toward that. Apollo [Adobe’s runtime platform] is working on better disconnected use. This is definitely going to put Sun in the game for rich Internet applications in a big way.” So could this mean the end of using AJAX to write rich Internet applications? Green replied, “Programming in scripting languages never dies, but is this likely to become the dominant method? Highly likely.” AJAX programming inevitably requires programming by content creators. Another problem with writing AJAX applications is it inevitably forces manual code creation, a skill Web content creators typically do not have. But Sun believes JavaFX eliminates that need. “The goal is to make it so people never have to see code,” said Gosling. Sun clearly intends JavaFX and FX Script for the masses that are not programmers. The promise of JavaFX is that it will allow for creation of content that plays on computers, digital TV, regular TV and mobile devices, and that the content will look the same across all platforms and behave the same way. Green is confident this can be delivered because mobile devices have become more powerful and able to handle richer applications. “This really is write once and run anywhere,” he said, reiterating a 12-year-old slogan for Java. The long-range plan is to make it so applications can be written to run on all platforms. Hammond thinks JavaFX could be come an alternative to AJAX, although AJAX has built quite a lead. “I like what they are doing, and anything they can do TO make the native Java UI model better from a programming point of view is great,” he said. Sun will disclose the release specifics at the show this week.
, “Java is out there in huge numbers. [JavaFX] will help to create a scripting language to use with your Java SE applications and libraries.”