yes but the syntax is incorrect: ajax('blog_show', 'comments hidden')
should be ajax('blog_show', [....], 'target_id') On Apr 28, 8:58 am, 黄祥 <steve.van.chris...@gmail.com> wrote: > hi, > > is it possible to put ajax function submit on script? > e.g. > <script> > jQuery(document).ready(function(){ > jQuery('.view').click(function() > {jQuery('.comments').slideToggle()}); > jQuery('.post').click(function(){jQuery('.form').slideToggle()}); > jQuery('.post').submit(function(){ajax('blog_show', 'comments > hidden')});}); > > </script> > > i've already tried it, no error occured but the ajax function didn't > work. my intention is when a user submit a comment form (using crud on > controller) it will show without reloading the page, or is there any > others way to do this? > > please give an advice and please correct me if my code is wrong. > > many thanks before