I have code that invokes an Ajax action in the controller that renders
a specific view into a <div>. The view includes an $ajax->link that
invokes a different Ajax action. The 2nd action renders a different
view into the same <div>. These two switch back and forth.
When I add a $javascript->codeBlock('alert("huh?");'); call to the
view, not only don't I see an alert, but the Ajax functionality stops
working, as well. In Firebug, I see no Javascript code in the Ajax-
updated <div>. However, looking at $this->output in the controller
just after the $this->render code, I see it.
I can guess only two possibilities. 1) the controller renders the view
but then filters out the Javascript code for some reason as it builds
the Ajax response (I use the 'ajax' parameter to the render call, by
the way). Or, 2) The Ajax Javascript in the <div> conflicts somehow
with the other Javascript and Firebug is lying to me.
I'm inclined toward explanation #1, but it's odd that $this->output is
unfiltered. The render call specified 'ajax'--if you want to filter
Javascript in the case of Ajax, I would think render would do it when
you utter 'ajax'. And why did the Ajax link stop working?
Does this sound familiar to anyone?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---