views:

129

answers:

3
+2  A: 

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

Luis
+1 - This is certainly a relative link issue, but consider using a CDN as well if it fits your situation.
Nick Craver
but what do you mean my website root?thats where it is already, it's in the same folder as the php file and I call it with:<script type="text/javascript" src="/jquery.js"></script>
rabidmachine9
check my edit above and good luck
Luis
this is definitely a +1, because it showed me the right direction...but I'll post an answer myself explaining what I didthanks!
rabidmachine9
+1  A: 

Also consider that if you use Codeigniter's default .htaccess configuration suggested in the Codeigniter URLs page:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

you won't be able to access a jquery.js file as a request for that resource will be rewritten to index.php; if this is a case you have to add that file as an exception:

RewriteCond $1 !^(index\.php|images|jquery\.js|robots\.txt)
kemp
A: 
rabidmachine9
It does by be careful, cause once you are deploying that to production you will have to rename the path again, as more than likely it will sit on the root folder, therefore i would recomend using the 3rd option in my answer above.
Luis
but how am I gonna use it like that?it doesn't work with my setup...should I rename my "CodeIgniter_1.7.2" folder as "myBlog" maybe?
rabidmachine9