If you make a XMLHttpRequest using $.ajax() in jQuery CakePHP will
only return the markup of the view, not the layout.

I believe you can achieve the same with .load() if you append
something to the query string, check that within in your action and
set the layout to 'ajax'. Which should give you a similar effect.

Though sending a XMLHttpRequest is recommended as it is core CakePHP
functionality. (Less hacking in your actions required).

On Mon, Aug 5, 2013 at 1:35 AM, glk <g...@kaup.com> wrote:
> Hello all, I've got more of a cake design question that a problem (at this
> point anyway).
>
> I'm using the htmlHelper and the $this->Html->css and $this->Html->script to
> make sure all the jquery and other stuff gets loaded properly.  My problem
> arose when I was using .load() to pull a different controller/action onto a
> jquery tab.  The new controller/action also included the very same jquery
> scripts in to the "tab".  Of course, this lead to many problems with all of
> the javascript.
>
> I would suggest here that the htmlHelper should have the ability to make
> sure that the css, scripts, and maybe even the meta should use some sort of
> singleton pattern to make sure they never get loaded more than once.
>
> In my particular case, it was easily fixed, but I can envision situations
> where I might not have control of the information on the "loaded" page
> information.
>
> Thanks for listening, and keep of the great work... I really enjoy working
> with the cakePHP framework.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Simon Males

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to