Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery and codeigniter

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

like image 666
rabidmachine9 Avatar asked Aug 31 '26 20:08

rabidmachine9


1 Answers

Place jquery.js in your website root and use:

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

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>

Or you can try this:

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

as described here

like image 198
Luis Avatar answered Sep 03 '26 11:09

Luis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!