From: James Britt Date: 2005-03-21T14:43:56+09:00 Subject: Re: [OT] Ajax: A New Approach to Web Applications vruz wrote: >>It seems as if several of us have written this at some point. I wrote >>mine completely in Javascript and called it Mediate. But will this >>ever have anything to do with Ruby? It seems to be all Javascript and >>XML (mine was Javascript and XHTML) >> >>I'm not knocking it with Ruby, I'm just not seeing a connection. Any >>enlightenment? > > > Maybe someone wants to develop Ajax-like apps for Ruby ? > > If so, James Britt has recently published a pretty neat library that's > related to this concept. > > It seems some other people call this technique "JSON", it's not XML > based but it basically serves for the purpose of transparently > transferring data structures between a language sitting on the httpd > and client side javascript. > > http://rubyforge.org/projects/orbjson/ There are some distinctions between using JSON-RPC (as with Orbjson) and AJAX. JSON-RPC certainly lets you pass XML around, but one important detail is that, like XML-RPC, you can also transfer complex objects, serialized as text. Client and server need not be concerned with the wire protocol, and can (sort of) behave as if all object method invocations are local. Another distinction is that some people using the XMLHttpRequest object specifically for XML are also loading and applying XSLT to transform the XML. This is not explicitly provided for in Orbjson, though it can readily be used to acquire the XML and XSLT from the server in a reasonably transparent fashion; after that, it's up to the client to use the data as it sees fit. BTW, I just posted to the Rails mailing list a walk-though of how to use Orbjson in Rails. It's quite simple; Orbjson makes it very easy to expose JSON-RPC services from Rails applications. James -- http://www.ruby-doc.org http://www.rubyxml.com http://catapult.rubyforge.com http://orbjson.rubyforge.com http://ooo4r.rubyforge.com http://www.jamesbritt.com