Hi,
I've gone through the tutorial, and would like the comments to be
submitted via ajax (as well as standard non-javascript submission).
I'm reasonably happy with what to do in the browser (via MooTools as
it happens), but server side I'm not sure:
- Ideally, I would like the Ajax submission use the same url as the
standard submission
- So would I need to "route" based on the X-Requested-With header, to
a new action: say 'PostCommentsAjax' action? How would I do this?
- Should this PostCommentsAjax action be a subclass of
PostCommentsAction? I would like to avoid copy/pasting the code from
PostCommentsAction.
For output I would prefer to
- Have all validation happen server-side, so I don't need to
repeat logic in the browser.
- Return HTML as output. This is so the Javascript doesn't need
to know about the structure of the comments, it can just inject the
html into the appropriate place on the page. However, it might be a
good idea to actually return a JSON object, with the html as one of
the values, as I might want other parameters passed back, like
"success:true" or something.
Can I ask for some pointers on how to achieve this?
Thanks,
Michal.
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users