On Thu, Apr 14, 2011 at 2:02 PM, Will <[email protected]> wrote:
> Thanks for the response!  Unfortunately that's not quite what I was
> looking for.  What I'm trying to do is essentially display the
> contents of a view as a result of an Ajax request rather than send
> JSON data as a result of a controller function (which is what the blog
> article was talking about).  My solution for now is basically to
> output the contents of the view and then append them to a div using
> jQuery.  I was apparently misunderstanding what the 'ajax' parameter
> was supposed to do.  If anyone knows of a cleaner way of doing this,
> I'm all ears, but my solution appears to fit my needs for now.

If you want to fetch HTML content through AJAX then you must append it
to something on the page. It doesn't get much cleaner than
$('#content').append(data). Although, if you want to replace some
existing content that's another story. But it's still a simple job
with jquery. There's also the load() function.

And, as Krissy said, use an ajax layout so the view doesn't come
wrapped in a regular layout.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to