Hi,

I've just been getting started with Ajax and I've been able to set up
a simple website using the pagesController that comes with cake. As
for now I'm not yet using any databases.

Today I started to try integrating some Ajax in my site. It's quite
simple: I want to load the pages into the 'content' div without
reloading the entire layout. So what I tried was the following: I
edited the pagesController by copying the display function and naming
it display_ajax(); Then all I changed was in the last line in the
render() function I added 'ajax'.

Now when I press an ajax link that loads the new display_ajax function
it displays in the 'content' div an error message saying that it can't
find the $javascript variable in my default.ctp layout file. That's on
the line where I load the javascript files ajax needs.

Now maybe I don't really understand how cake works yet, but I think
this is weird. First off, I thought by setting the 'ajax' value in the
render function, the layout shouldn't be loaded at all. And even if it
should (apparently so, can someone explain?) then why does it return
this error, when it doesn't return any errors if I use the standard
display() function. The functions are the same!

I hope someone can help me with this! Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to