Hi Marco,
Here is what I do:
<?php e($html->link('Cancel', '/admin/home', array('class'=>'button',
'onclick'=>'javascript:$("#admin-area").load("/admin/home");return
false;')));?>
You need to make sure you have the RequestHandler component loaded,
otherwise when you update your div, it will load the whole site with
view, not just the view.
Tane
On 4/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi
> I'm using Cakephp with jquery.
>
> I would use the Jquery Ajax function inside my general view named
> "index.thtml".
>
> I would use the load function exactly for change the content of a div
> when I click on a image .In this div I would load a particular view
> named "view_part.thtml".
>
> How can i do this?
> I've used this code in my general view "index.thtml"
>
> echo $javascript->codeBlock('
>
> function load_view (div_id,parameter)
> {
> $("#div"+div_id).load("view_part/parameter");
> }
> ');
>
>
> <div id=div1></div>
>
> <?php echo $html->link($html-
> >image(,array('onClick'=>'load_view(1,parameter)','javascript:void(0);',null,false,false);
> > ?
> >
>
> But it doesn't work.
> What's wrong
> Can me do an right example?
> Thank a lot
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---