FJAX: Ajax with Flash

O’Reilly editor Brian Sawyer pointed me to this interesting webmonkey article on FJAX, a Flash-powered variant of AJAX.

“Fjax is an alternative method for doing the kind of Web 2.0 builds that are currently done in Ajax. The advantage is that it does it in a fraction of the size, and requires no code forking to work in the different browsers. It’s a streamlined way of doing asynchronous content updates with XML…

 

Fjax uses the Flash Player to load a 1 pixel by 1 pixel transparent SWF to simply get XML from the server. Once it has the XML, it parses it into HTML and then lets JavaScript know it’s ready. JavaScript then gets the HTML from Flash and DHTMLs it into the web page — it uses JavaScript to write (X)HTML/CSS onto the page.

In the end, Fjax gets XML and delivers HTML. It doesn’t collaborate with Ajax. It doesn’t need to. It doesn’t load data visually into a Flash movie for presentation. It could, but that is not the point. It doesn’t generate SWFs or require a server side component. It is its own thing. Oh, and did we mention it’s only 65 lines of code? And it’s free.”

This does sound interesting, since Flash is indeed ubiquitous and powerful. Using the Flash engine to enable portability without requiring too much in the way of changed development practices and tools could be interesting. (Although to be fair, Flash Actionscript is really just Javascript with some extensions, and for many uses, many of the constructs that Flash provides for animation, like the timeline, which was a struggle for many developers, are not needed.)

But does it work? I just went to the Fjax site (using Firefox on a Mac) and got this message (from vbscript no less): Error parsing XML Data Error parsing XML Data Error parsing XML Data [Note: Jay McDonald writes in the comments below that this was an overload on the server host website, and has been fixed. The site now works fine. In any event, not a problem with fjax. The site is quite snappy now.]

Disclosure: I was formerly a director for Macromedia, but since the acquisition by Adobe, I have no relationship to the company beyond those of a publisher on Adobe technologies.

tags: