Ajax and Grails for Dummies
===

I am a rookie Grails user and I am completely new to AJAX. I am not exactly grasping the concept of AJAX, and the material online is fragmented. 

From my understanding, in grails if I wanted to execute a method in one of my controllers when a part of my HTML doc loads I could simply use something along the lines of

    <div onload="${remoteFunction(action:"foo", update:"foo"...)}" ...>

1. How is the response from the call to the hypothetical foo returned and how can I access it in a js function?
2. Can I return an object from a class I created from my hypothetical foo action?