views:

49

answers:

2

what does ./CoverFlows_files/coverflow.js mean?

I understand ../CoverFlows_files/coverflow.js means [move up one directory] And /CoverFlows_files/coverflow.js means [go down from here]

Also is there are way to get to the root like in asp.net its ~/ ...?

The other thing I dont quite understand is where to put

<link rel="stylesheet" type="text/css" href="CoverFlows_files/coverflow.css">

and

<SCRIPT type="text/javascript" src="./CoverFlows_files/coverflow.js"></SCRIPT>

Do these two tags have to go in the head or in the body or does it not matter?

I suppose if anybody has a link to a webpage that goes over these basic topics that would be immensly useful.

Regards PQ

+4  A: 

./ mean current directory

CoverFlows_files/coverflow.css and ./CoverFlows_files/coverflow.css are basically same

/CoverFlows_files/coverflow.css is absolute path from domain name

For Example http://yoursite.com/CoverFlows_files/coverflow.css same as /CoverFlows_files/coverflow.css

Regarding stylesheets and scripts, you could put it anywhere

But good practice to speed up your web site is

Put Stylesheets at the Top

Put Scripts at the Bottom

S.Mark
+2  A: 

Paths aren't used only in "web-environments" so I'll try to explain it a but further. (I'll use following syntax: where we are + what path we type = what's the absolute path)

  • ./path/to/file search only in current dictionary:
    • /home/crozin + ./path/to/file = /home/crozin/path/to/file
    • http://blah.com/support/ + ./path/to/file = http://blah.com/support/path/to/file
  • /path/to/file is absolute path:
    • /home/crozin + /path/to/file = /path/to/file
    • http://blah.com/support/ + /path/to/file = http://blah.com/path/to/file
  • path/to/file search in every directory from include_path (OS variable). So if include_path is set to: .;/home/crozin;/tmp then it'll search in:
    • /home/crozin + path/to/file = ./path/to/file and /home/crozin/path/to/file and /tmp/path/to/file
    • http://blah.com/support/ + path/to/file = http://blah.com/support/path/to/file (basically the same as first example)

In ...: url(...) always use absolute path. In "web-environments" it's easiest style.

Crozin