> > From my perspective, the whole Ajax Helper (may it be for Prototype or
> > jQuery) is not an option for an application that seeks a serious
> > implementation.
>
> +1 to that!
>
> Specially if you are using JQuery (or anything which can really be 
> unobtrusive)

if you need to use cake's helpers (html etc) in your JS, you could
create a JS layout with:

// views/layouts/js.thtml
<?php
        header("Content-type: application/x-javascript");
        echo $content_for_layout;
?>

you could then create a JS controller, or a folder in pages called js, eg:

// views/pages/js/test.thtml

$(function() {
  $('#guestbook').click(function() {
     $('#spinning_image').ajaxStart(function() {
        $(this).show();
        $('#content').hide();
      }).ajaxStop(function() {
        $(this).hide();
        $('#content').hide();
      });
      $('#content').load('<?php echo $html->url('/controller/ajax_method'); ?>
 }
});

this file could be incorporated into any view then using the head_helper:

// Controller/Action

$head->register_js("/pages/js/test");

actually, just realised the head_helper would need some tweaks to work
as it would put '.js' on the end which would stop the file being
loaded.

hope this helps.

jon


-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to