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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With