CodeIgniter Forums
Path to script files - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Path to script files (/showthread.php?tid=2615)



Path to script files - El Forum - 08-14-2007

[eluser]danfloun[/eluser]
I'm using jquery.js and I'm just wondering how I can include these scripts without having to use the full site url in my .php files.

At the moment it only works if I do,

Code:
script src="http://localhost/jquery.js"></script

I want to just use src="jquery.js"

I tried moving the script to root folder (htdocs) but it never worked. In fact I moved it most places and it didn't work.

So how?

Secondly, whats going on with his forum. Everytime I post or edit, half of my scripts disappear?

Thanks

Danny


Path to script files - El Forum - 09-04-2007

[eluser]Delian Angelov[/eluser]
Try using this instead:
script src="/jquery.js"></script


Path to script files - El Forum - 09-04-2007

[eluser]Michael Wales[/eluser]
Common practice is to create an assets folder which houses all of your images, stylesheets, and script files.
A structure similar to:
Code:
assets
- css
- img
- js

Then use:
Code:
script src="/assets/js/jquery.js"></script

Personally, I just ditch the assets folder and place css, img, and js at the root level.