jquery和codeigniter [英] jquery and codeigniter

查看:70
本文介绍了jquery和codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

和对不起,如果这个问题是愚蠢的
我试图使用javascript与codeigniter,我不能得到它
我实际上是把jQuery放在views文件夹
并从我的一个视图文件
调用它:

and sorry if that question is stupid I'm trying to use javascript with codeigniter and I can't get it right what I'm actually doing is placing jQuery inside the views folder and call it from one of my view files like that:

<script type="text/javascript" src="jquery.js"></script>

我没有回应没有错误,只是不工作,我也可以显示更多的代码,但我的第一个假设是有一些错误的方式我调用它...
可能是路径的东西?

I get no response no errors it just doesn't work, I could also display more code but my first assumption is that there something wrong with the way I call it... maybe something with the paths?

任何解决方法?


。提前感谢

any workarounds?

thanks in advance

推荐答案

将jquery.js放入您的网站根目录并使用:

Place jquery.js in your website root and use:

<script type="text/javascript" src="/jquery.js"></script>

如果你想把它说在一个js文件夹,将文件夹放在root中,然后执行: / p>

If you want to put it say in a js folder, place the folder in root and do:

<script type="text/javascript" src="/js/jquery.js"></script>

或者您可以尝试:

<script type="text/javascript" src="<?=base_url();?>js/jquery.js"></script>

here

这篇关于jquery和codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆