Saturday, October 30, 2010

Re: cakephp 1.3.5 and jquery - what am i missing?

On Sat, Oct 30, 2010 at 1:10 PM, Jeff T <jeff@pre23.com> wrote:
> Hi All,
>
> I'm new to cakephp and it's clear there's something very basic that
> I'm missing.  I'm trying get jquery to work within cakephp.  I don't
> see any errors in firebug but it's clear that the js file is not
> processing, however the css file does.

Use Firebug to see if the javascript has even been loaded.

> I'm trying to get jquery working on my homepage.
>
> I have this in my default.ctp found at /vars/www/app/views/layout/
> default.ctp
>
> <link rel="stylesheet" type="text/css" href="/css/
> siteFeature.style_screen.css" />
> <?php echo $javascript->link(array('jquery-1.3.2.min.js',
> 'jquery.siteFeature.pack.js')); ?>
>
> the js files are found at:
>
> /vars/www/app/webroot/js/
>
> This is in my page_controller.php found at /vars/www/cake/libs/
> controller/pages_controller.php
>
> var $helpers = array('Html', 'Ajax', 'Session', 'Form', 'Html',
> 'Javascript', 'Time');
>
> Thank you and I hope someone can help me with this.
>
> Jeff

JavascriptHelper has been deprecated in 1.3.x so use
$this->Html->script(array('jquery-1.3.2.min',
'jquery.siteFeature.pack'));

Note that you do not include the .js extension.

Also, if you're loading the JS in your layout, you should include
HtmlHelper in AppController so it's available to all controllers. And
you have Html listed twice above, btw.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: