Problem using js jquery helper
I am using cakephp 1.3.6 and am trying to use inbuilt js helper. I have added
var $helpers = array('Js' => array('Jquery'));
in my controller. In my layout, I have included the jquery files and have also included
echo $this->Js->writeBuffer();
before the </body>
tag.
I check开发者_Go百科ed if the jquery libraries correctly but trying to create a simple accordian from the jqueryui.com, it works fine.
But when I try
<?php
$this->Js->get('#element');
$this->Js->drag(array(
'container' => '#content',
'start' => 'onStart',
'drag' => 'onDrag',
'stop' => 'onStop',
'snapGrid' => array(10, 10),
'wrapCallbacks' => false
));
?>
<div="element">something</div>
It does not work.
I appreciate any help.
Thanks.
I never did see the point in all that nonsense. Just include jQuery the traditional way by writing a statement by whatever means you prefer - I use something like
echo $javascript->link('jQuery/jquery-1.3.2');
Then any javascript, I write as javascript.
精彩评论