Activate your free membership today | Log-in

Friday, April 6th, 2007

Jester: JavaScriptian REST

Category: JavaScript, Library

The nice giant robots have smashed away a JavaScript REST implementation that is inspired by the Rails ActiveResource library.

Jester builds on Prototype and ObjTree, a nice DOM parsing engine for JavaScript.

Take a peak at how it works via the examples (run in Firebug):

JAVASCRIPT:
  1.  
  2. Base.model("User")
  3. Base.model("Child", "http://www.thoughtbot.com", "child", "children")
  4.  
  5. var eric = User.find(1)
  6. //GET http://localhost:3000/users/1.xml
  7.  
  8. var floyd = User.create({name: "Floyd Wright", email: "tfwright@thoughtbot.com"})
  9. //POST http://localhost:3000/users.xml
  10.  
  11. var chad = User.build({email: "cpytel@thoughtbot.com", name: "Chad Pytel"})
  12. chad.new_record()
  13. chad.save()
  14.  

Holy client-side programming batman!

( via Alex MacCaw )

Posted by Dion Almaer at 5:45 am

+++--
3.5 rating from 31 votes

Comments Here »

Comments feed TrackBack URI

Leave a comment

You must be logged in to post a comment.