Forums
This topic is locked
Document Relative link question
Posted 03 Nov 2003 15:23:37
1
has voted
03 Nov 2003 15:23:37 David Stoltz posted:
I realize the differences between relative links:
../images/pic.jpg is a document relative link
/images/pic.jpg is a root relative link
But I've seen things like this:
./images/pic.jpg with only one dot - what does this mean? Is this simply a shortcut?
Thanks
Replies
Replied 08 Nov 2003 07:23:02
08 Nov 2003 07:23:02 Nozomi Kugita replied:
Hi dstoltz,
./ is also a document relative path. The single dot means "current directory".
So ./images/pic.jpg is that you are specifying:
the pic.jpg file in images directory which is located in the current directory.
Hope it helps.
Noz
./ is also a document relative path. The single dot means "current directory".
So ./images/pic.jpg is that you are specifying:
the pic.jpg file in images directory which is located in the current directory.
Hope it helps.
Noz
Replied 10 Nov 2003 15:04:22
10 Nov 2003 15:04:22 David Stoltz replied:
Thanks - so what you're saying is
img src="./images/pic.jpg"
is the exact same as:
img src="images/pic.jpg"
????
That seems silly to even bother with the "./" then.....
img src="./images/pic.jpg"
is the exact same as:
img src="images/pic.jpg"
????
That seems silly to even bother with the "./" then.....
Replied 11 Nov 2003 06:12:24
11 Nov 2003 06:12:24 Nozomi Kugita replied:
Using "." (single dot) to represent a current working directory becomes very handy when you work on Unix environment. Unix has a concept of $PATH. If the command or the program you attempt to run does not exist in "your directory path" specified for $PATH, the system will not recognize it, thus will not run it.
If your current directory includes the program or the command, you want to run it by "./myProgram" rather than writing its absolute path because an absolute path can be very long sometimes and you just want to lower possiblities of mistyping.
Anyway, as far as an anchor tag is concerned, it does not really matter if you specify a relative link with "./" or without. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
- noz
Edited by - Noz on 11 Nov 2003 06:26:24
If your current directory includes the program or the command, you want to run it by "./myProgram" rather than writing its absolute path because an absolute path can be very long sometimes and you just want to lower possiblities of mistyping.
Anyway, as far as an anchor tag is concerned, it does not really matter if you specify a relative link with "./" or without. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
- noz
Edited by - Noz on 11 Nov 2003 06:26:24
Replied 11 Nov 2003 15:06:18
11 Nov 2003 15:06:18 David Stoltz replied:
Now I got it...
Ok that makes sense!
Thanks for the explaination!
Ok that makes sense!
Thanks for the explaination!