Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Image Calling Problem Solved, I was having issues trying to call an image from a folder.
blackhatdacx
post 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.
Go to the top of the page
 
+Quote Post
jlhaslip
post 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 Icon

Group: [MODERATOR]
Posts: 3,882
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. My First Image(12)
  2. Image Weaver(0)
  3. For Anyone Who Wants To Have Compact Image Gallery(4)
  4. Move/delete Image On Webpage Automatically?(2)
  5. Image Splicer?(1)
  6. Rollover Image Tutorial(2)
  7. Avoid Image Download(6)
  8. Syndicated Image Feeds(0)
  9. Image Refresh(5)
  10. Image Galleries(10)
  11. Use Cell Background Image On Css?(2)
  12. Making A Scroll Bar In Flash(4)
  13. How Do You Enlarge An Image?(8)
  14. Hoverbox Image Gallery(1)
  15. Selecting Specific Part Of Image And Adding Description(6)
  1. Can't Delete A Folder On Server!(7)
  2. How Do I Put A Flash Image In My Website(10)
  3. What Do You Prefer? A Subdomain Or A Url With A Folder Name?(16)
  4. Image Not Taking The Right Size In Web Page(1)
  5. Image Anywhere(2)
  6. Cascading Windows(5)


 



- Lo-Fi Version Time is now: 26th July 2008 - 03:17 PM