Thursday, August 27, 2009

Re: ajax remoteFunction problem

Thanks. I'll give that a try. For now I had just modified h() in
basics.php to get it to work.

On Aug 13, 2:26 am, "Dr. Loboto" <drLob...@gmail.com> wrote:
> <script language="JavaScript">
> function new_heading(heading) {
>       var name =prompt("Enter a heading name", "");
>       new Ajax.Updater(
>            'heading_list',
>            '<?php echo $html->url('/calendars/add_heading/'); ?>' +
> name + '',
>            {
>                 asynchronous:true,
>                 evalScripts:true,
>                 requestHeaders:['X-Update', 'heading_list']
>            }
>       );}
>
> </script>
>
> On Aug 13, 1:05 am, bondo <kevd...@gmail.com> wrote:
>
> > The function h($text) in /cake/basics.php has changed and is causing
> > the problem for me. It now uses htmlspecialchars which escapes the
> > single quotes. In the beta version it didn't do this.
>
> > Without modifying that code, how can I solve my problem so that it
> > does not escape the single quote?
>
> > On Aug 12, 11:08 am, bondo <kevd...@gmail.com> wrote:
>
> > > I just upgrade from an old 1.2beta version to 1.2.3.8166 but I'm
> > > having a problem with using the remoteFunction now.
>
> > > This is the code I have:
> > > <script language="JavaScript">
> > > function new_heading(heading) {
> > >                 var name =prompt("Enter a heading name", "");
>
> > >                 <?php
> > >                         echo $ajax->remoteFunction(array
> > > ("update"=>"heading_list", "url"=>"/calendars/add_heading/' + name +
> > > '"));
> > >                 ?>}
>
> > > </script>
>
> > > With the old version, when I view the source in a browser, it would
> > > look like:
> > > new Ajax.Updater('heading_list','/calendars/add_heading/' + name + '',
> > > {asynchronous:true, evalScripts:true, requestHeaders:['X-Update',
> > > 'heading_list']})        }
>
> > > Now however, it looks like:
> > >                 new Ajax.Updater('heading_list','/calendars/
> > > add_heading/&#039; + name + &#039;', {asynchronous:true,
> > > evalScripts:true, requestHeaders:['X-Update',
> > > 'heading_list']})        }
>
> > > It doesn't work with the escaped apostrophe's. How can I fix that? I
> > > haven't been able to find anything on it. Thanks.
> > > Bondo.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: