I'm not sure what answer you want..
With Ajax you request an url..
On request completed, the return of that url is Ajax.lastdata..
You can set a text or a variable to that and do anything you want with it..
there are just two things
on start of layout
Ajax request url
Ajax on completed
set (text or variable or Array) to ajax.lastdata