My code is this:
Index.thtml:
<div id="div_id"></div>
<?php echo $ajax->link('New','#',
array(
'update'=>'div_id',
'url'=>'/post/new/'
)
,null,false); ?>
New.thtml:
<?php echo $javascript->link('myJS') ?>
<?php echo $javascript->codeBlock('
myJSfunction();
')
?>
If I execute post/new all works fine.
If I execute post/index it doesn't work.
On 5 Dic, 09:13, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Yes I'm using prototype.
> I'm using Ajax helper.
> I'm using $ajax->link and from Html code I can see that evalScript is
> already set to true.
>
> On 4 Dic, 19:11, Christophe Cholot <[EMAIL PROTECTED]> wrote:
>
> > On Dec 4, 5:22 pm, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > Hi I have a question
> > > I have a index.thml where there are many divs.
> > > Then with ajax I substitute one of divs with anotherview
> > > (view.thtml).
> > > In thisviewI use ajavascriptfunction attached to a link.
> > > So If I define this function inview.thtml I get an error instead I
> > > define the function in index.html all works fine.
> > > But I would define the function inview.thtml because I use this
> > > function only in thisview.
> > > How I can do This ?
> > > Many Thanks
> > > Marco
>
> > Hello,
>
> > WhatJavascriptlibrary are you using ?
>
> > With prototype, if think you can set evalScripts to true as an option
> > when using Ajax.Request. You can also play with onSuccess callback to
> > get things done.
>
> > I hope it helps !
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---