|
|
|
|
![]() ![]() |
Feb 4 2008, 10:05 PM
Post
#1
|
|
|
Newbie [Level 1] ![]() Group: Members Posts: 15 Joined: 11-January 08 From: Toronto, Ontario. Member No.: 56,083 |
Alright so this is for example
You'd have a site and the structure is like this. http://www.url.com/ a folder of images /images/ and some pages in this parent directory. However, I have another folder so it's http://www.url.com/other/ and this index page needs to call things from http://www.url.com/images/ and it can't. It won't load. I've had the call be to CODE <img src="images/" or <img src="../images/" and <img src="http://www.url.com/images/" It doesn't work. I can't call to the URL 'cause the server dosen't allow remote calling, changing that is not an option. It won't call from a directory cause it'll think it's that directory it's calling in like it'd goto http://www.url.com/other/images not http://www.url.com/images and I can't make it go back, it only works for server side stuff, and I'm going like a background image for example. Why would I need to call a server side to bring in a background image. I went back and I figured that the problem was because the code was without a / in the folder call CODE <img src="/images/ So let this be a lesson learned! If you are not getting the result you want. Make sure to check and check and check and check again your code. The solution is in the environment. |
|
|
|
Feb 5 2008, 12:35 AM
Post
#2
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,882 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
Couple of things to add to this discussion.
1. The href is incomplete. You are lacking the file reference in the sample code. I added file_name.jpg to correct it. 2. You are missing the title attribute, which acts as the 'tooltip' for the on-hover event. I added that. 3. You failed o close the image tag. I added it, too. Your html code should read as follows: CODE <img src="http://www.url.com/images/file_name.jpg" title="Title here" /> <img src="./images/file_name.jpg" title="Title here" /> <img src="../images/file_name.jpg" title="Title here" /> Depending on the position of the Images folder relative to the calling file, one of those should work. The "./" is if the Image is referenced from the same folder. Likely so in your case. The "../" is if the Image is referenced from 'up' one folder and then into the Images folder. The Http reference is 'absolute' to the URL. The thing to use if the Images are stored on a Web Server outside your Domain, for example, but it could also be the same Domain. Using the first or second example makes your code more portable, in that the reference is relative to the html page and does not tie the Image source to a particular Server location. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 26th July 2008 - 03:17 PM |