问题描述
这个简单的问题让我很疯狂..
http://www.mediafire.com/?2vi2kc7tpqiw1to
这是幻灯片代码包含CSS,HTML,jQuery代码。
这张幻灯片工作正常,但是当我在cakephp不是
工作。
我把jQuery文件和CSS放在webroot,并把代码包括在
layout / default.ctp like this
echo $ javascript-> link('jcookie.js');
echo $ javascript-> link('jquery-1.3.2.min.js');
echo $ javascript-> link('jcarousellite.js');
echo $ javascript-> link('jquery-1.js');
但仍没有任何反应..请任何人帮助我...下载幻灯片并尝试点击
a)你shouldnt使用$ javascript了。它将是$ this-> Javascript
b)javascript本身已弃用(参见文档)
使用
$ this-> Html-> script()
pre>
详情:
Wait moment this question not duplicated..it is sample and difficult at the same time.
This simple problem make me crazy..
http://www.mediafire.com/?2vi2kc7tpqiw1to
This is slide code contain CSS, HTML, jQuery code.
This slide works fine, but when I include this slide in cakephp it is notworking.
I put jQuery files and CSS in webroot and put the code to include inlayout/default.ctp like this
echo $javascript->link('jcookie.js'); echo $javascript->link('jquery-1.3.2.min.js'); echo $javascript->link('jcarousellite.js'); echo $javascript->link('jquery-1.js');
but still nothing happen ..please anyone help me..download the slide and try to click on the top to slideshow pictures..and then include it in cake..you will find the problem..
解决方案a) you shouldnt use $javascript anymore. it would be $this->Javascript
b) javascript itself is deprecated (see the documentation)
so use
$this->Html->script()
details:http://book.cakephp.org/view/1589/script
这篇关于如何在cakephp 1.3中包含javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!