By the way, I am using the pre-beta release. Also, the problem is
alluded to in the closing of this ticket: https://trac.cakephp.org/ticket/2690
. The ticket is closed by the statement:
... The correct layout is used for bare or ajax routes, but you cannot
execute javascript from an ajax layout if the request is made with
ajax.
Sincerely
Nina Jansen
On Dec 12, 11:16 pm, Nina <[EMAIL PROTECTED]> wrote:
> This is the experiment I tried: the following code is a part of a view
> element that is rendered with and without the ajax layout:
>
> <?php echo $ajax->autoComplete('Tag/tag', '/tags/
> autoComplete',Array('value' => $tag_value));?>
>
> First rendereing of the element with the default layout gives this
> output (output 1):
>
> <input name="data[Tag][tag]" id="TagTag" autocomplete="off" value=""
> type="text">
>
> <div style="display: none;" id="TagTag_autoComplete"
> class="auto_complete"></div>
> <script type="text/javascript">new Ajax.Autocompleter('TagTag',
> 'TagTag_autoComplete', '/tags/autoComplete', {});</script>
>
> Second rendering of the element, using the ajax layout gives this
> output (output 2):
>
> <input name="data[Tag][tag]" value="" id="TagTag" autocomplete="off"
> type="text">
> <div style="display: none;" id="TagTag_autoComplete"
> class="auto_complete"></div>
>
> i.e. no javascript. Now I change the template so that I insert output
> 1 directly into the template and remove the call to the ajax helper.
> The resulting output is output 2. The script is gone.
>
> I have no idea why this happens, but it happens.
>
> Sincerely
>
> Nina Jansen
>
> On Dec 12, 10:37 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On Dec 12, 2007 4:32 PM, Nina <[EMAIL PROTECTED]> wrote:
>
> > > I'd like to bump this problem, because I have exactly the same issue.
>
> > > I have attempted to use javascript instead of using the helper, but
> > > somehow the renderer strips the javascript away. I don't know if this
> > > is a feature of some sort, but if it is, I'd like to know how to
> > > disable it.
>
> > I have never seen the renderer 'strip the javascript away', so this
> > sounds like there is different problem. Why on earth would would a
> > renderer get rid of anything you put in your templates?
>
> > --
> > Chris Hartjes
>
> > My motto for 2007: "Just build it, damnit!"
>
> > @TheKeyboard -http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---