Archive for the 'Ajax' Category

h1

JSON trumps Ajax for Mashups

Monday, December 19th, 2005

I’ve spent a lot of time over the years playing with different methods of having a web page get data from the server without refreshing the page. One of my major criteria has been to find a method that works across all browsers. A few different methods have cropped up over time, following an evolutionary path.

In 1998, I used Microsoft Remote Scripting, which used a Java applet for its transport layer. Java later became a problem, since it’s blocked by firewalls and no longer automatically supported by all of the main browsers.

In 1999 I started experimenting with frames, then a hidden Iframe, which I used in my JSRS library in 2000. Iframes have become deprecated as of the XHTML specification, and browser history can be affected by their use, making this workable but suboptimal.

In 2000 I wrote RSLite which uses a client-side image object and a cookie. This works across pretty well all browsers but has limited value due to url and cookie length limits.

I started to use and promote Microsoft’s XMLHttp object fairly early on, but its limitation to IE and at that time only beta Mozilla made it not-ready-for-primetime. It has since come into its own in the form of Ajax, however there are still cross-domain scripting limitations, which are an impediment to the kind of Web 2.0 mashups that are some of the most compelling new uses of browser technology.

Danne Lundqvist was amongst the first to talk about the idea of using dynamically-generated script tags to send and receive data. In conjunction with Douglas Crockford‘s JSON JavaScript Object Notation, this method has recently been promoted by Yahoo in their Javascript Developer Center as a way to perform cross-domain data transmission.

Full coverage of the method can be seen on Dan Theurer‘s blog.

I am beginning to think that the combination of JSON and On-Demand-Javascript holds a great deal of promise:

  • Great cross-browser compatibility
  • It is not a hack. Cross-domain script tags are a designed-in browser feature. DOM manipulation is central to modern browsers
  • JSON is a great compact object notation, native to JavaScript yet already implemented in many server-side languages and easy to do for others

It may be just another crayon in the box, but I think it’s going to get a lot of sharpening now that Yahoo is actively promoting JSON.

h1

Ajax / JSRS / Google Map / Network Monitoring Example

Monday, July 11th, 2005

Tim Aiello has built a network monitoring app using Google Maps and JSRS to make Ajax calls.

Much of the stuff I do day-to-day lately has to do with network monitoring and configuration management for a Canada-wide network of 802.11x wireless sites. This type of map integration could be very useful.

h1

Ajax Cap

Wednesday, June 1st, 2005

I finally got the Ajax soccer team cap I ordered on April 20th.

I had hoped to wear it to the Ajax Summit for a bit of fun, but it took 6 weeks to arrive, so now I just have a nice sturdy well-made hat without any abstruse referential attachment unless I start hanging around at web development meetups.

h1

Econometa launch

Monday, May 16th, 2005

Adam Marsh has come out of the gates running with his new Econometa blog.

I met Adam last week in San Francisco and he struck me as an insightful and knowledgeable guy who contributes well to a conversation. Just the kinda guy to add to my blogroll.

Speaking of blogroll, I’ve got some maintenance to do. I’ve recently updated my MT installation so I’ll be tweaking here in my copious free time.

h1

Hacky Sack

Monday, May 16th, 2005

Here’s a great example of unobtrusive Ajax in action to solve one of the most annoying problems about web forms – auto-saving textarea input so you don’t lose your uncommitted work in a browser crash.

And it’s all made possible by Gregory Wild-Smith’s Sack of Ajax library – although it’s hard to really call something that light a library, it would hardly fill an index card!

h1

Ornithological flamefest

Friday, May 13th, 2005

There’s a certain amount of uninformed griping going on over at BurningBird.

h1

Can’t be in two places at once.

Thursday, May 12th, 2005

Wow, I wish I had been there, heh heh.

h1

Back from the Ajax Summit, whistling a happy tune.

Wednesday, May 11th, 2005

I’ve spent the last couple of days in San Francisco at the Ajax Summit hosted by O’Reilly and Adaptive Path. You can find notes on the summit at Ajaxian.

Many many thanks are due to Adaptive Path and O’Reilly for having the foresight to draw together such an exciting multidimensional braintrust.

Since Jesse’s article a few months ago which coined the Ajax name, the community has sounded like an orchestra warming up – many players making squeaks and squawks, adjusting their tuning along the way, the odd trumpet blast and cymbal crash. This summit brought us all together and introduced us to this new arrangement of an old favourite and while we’re not ready for Carnegie Hall, we ended up with some very pleasant harmonic passages, the odd memorable solo, and the sense amongst all of us that we’re now going off in our different directions humming our own variations of the same tune.

I came up with an architectural diagram shown below which, while open to refinement, describes for discussion purposes the layers of communication in a rich internet application, and it forms the basis of this newly arranged WebDev favourite. The toolkits that are currently available and being developed provide different ranges of coverage of the model, allowing you to:

  • have the toolkit do it all from top to bottom (e.g. Ruby on Rails)
  • provide your own back end and have the middle and front end taken care of for you (e.g. JackBe, which has an incredible toolset)
  • use a component based framework like Dojo, where you can plug in different transport (iframe, XMLHTTP, script injection) or encoding layers (XML, JSON, delimited text)
  • make browser-based RPC calls with SAJAX and do the UI part yourself
  • intertwine HTML/CSS and Flash, use Flash for behind the scenes transport and advanced presentation (did you know that there are open source Actionscript compilers now? Flash sure ain’t any more what you think it was)

These are vastly different approaches, but we agreed that they are all forms of Ajax – using sub-page information transfer to support a rich interface that allows developers to be freed from some of the constraints of conventional stateless http page-refreshing web design and to be able to better collaborate with user-experience focused UI designers to make applications that are intuitive and responsive.

Please, by all means, join into the conversation wherever you see it discussed and however you want to contribute.