| img src anomaly using ../ in public_html |
Kallym

msg:4232639 | 3:53 am on Nov 20, 2010 (gmt 0) | Hi, I came upon something curious today. The following code is in a file in a public_html folder. I expected the first paragraph to display a broken image, but both images showed fine. I checked in three browsers. The only thing I could come up with is that the browsers are ignoring the ../ in the first paragraph since the file is already in web root. I tried to Google it to see if it was documented, but could find nothing. I could swear I've accidentally added a ../ to an img src in a public_html file before and got a broken image.
<p><img src="../assets/images/image-2.jpg" width="300" height="194" alt="" /></p>
<p><img src="assets/images/image-2.jpg" width="300" height="194" alt="" /></p>
Is this something I have just never noticed before? Or am I missing something? :-) Thanks!
|
topr8

msg:4232656 | 6:02 am on Nov 20, 2010 (gmt 0) | you just haven't noticed it before. ../assets and assets are equivalent paths
|
Kallym

msg:4232665 | 7:27 am on Nov 20, 2010 (gmt 0) | Thank you. Am I right in assuming you meant "...are equivalent paths if the code is used in the web root." ie. if you are in some subfolder then ../assets/ and assets/ would definitely not be the same thing. I can't believe I've never noticed that. Still Learning! :-)
|
tedster

msg:4232745 | 5:28 pm on Nov 20, 2010 (gmt 0) | | if the code is used in the web root |
| yes, exactly so.
|
Kallym

msg:4232822 | 8:49 pm on Nov 20, 2010 (gmt 0) | Thank You!
|
|
|