In the world of shells, ./
is fairly common and not considered to be a dangerous way to refer to the current directory when specifying a path.
In HTML, however, we almost always leave out the ./
and just put the name of the file we want. Is this a stylistic convention, or is it due to some browsers simply not understanding ./
to mean "Current Directory"?
The reason to use this in the shell is that the shell looks up executable commands in a mix of its internal commands, PATH directories and the current working directory. By using ./command
, you unambiguously tell it to use command
in the current directory, not elsewhere.
This does not apply to HTML/HTTP at all, so there's no good reason to use it. path
and ./path
always mean exactly the same thing in HTML.
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