title: Ajax-ish updating of a canvas element
body: <p>Ok this is more of general technology/approach question.</p>
  
  <p>We have a very simple web 'app' which is basically just a canvas element. We're using javascript to draw a 'fancy UI' on the canvas. We register a mouseclick event, get the coordinates and then try to figure out what widget they clicked on.</p>
  
  <p>My question is, what technology or framework would be best for doing this in an AJAX-ish sort of way? I want the page to render, then user the user clicks somewhere on the canvas, and we pass that coordinate back to some server-side code(PHP or Ruby) which will run some logic, update a database etc., and then come back with new data for the javascript Draw method, effectively updating the UI based on what the user selected, all with a minimum of blinking and refreshing.(although the canvas can be in an IFRAME)</p>
  
  <p>What's the easiest approach to this? I've looked a little at Rails, but it seems like overkill. All I want is to pass back the click coordinates, run some server-side code, and come back with a new chunk of text to pass my javascript Draw function(the one that draws on the canvas element)</p>
  
  <p>EDIT: ok, to be more precise, I'm essentially asking about the easiest way to post back simple string data via AJAX(meaning no full page refresh), and receive a string return value, and update a canvas tag with that return value. I'm not asking for code or an example(although I wouldn't complain) I'm just asking for thoughts on the easiest tech to use - jQuery, Prototype, Rails, JSON vs. XML, etc. The back end is all PHP or Ruby, so I dont need help there, just with the AJAX->Canvas portion of it.</p>