Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

img src

Status
Not open for further replies.

sirduke

Instructor
Apr 12, 2002
3
US
When I create a web page with the tag <img src=&quot;imagefile&quot;> Internet Explorer only displays a box with an 'x' in it. what should I do?

I also tried <img border=&quot;0&quot; src=&quot;imagefile&quot; width=&quot;131&quot; height=&quot;165&quot;>

the image is in the same folder as the html. jpeg format

 
that means the path is incorrect.
example
if both are with in the same director
<img src=&quot;imagefile&quot;>
if the image is in the images directory aside from teh html page
<img src=&quot;images/imagefile&quot;> ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
otherwsie sense you stated the same folder then check the name of the image for case etc..

if you recieve the X then the image is not being found so either the directory is wrong or the name is wrong. I don't think I've ever seen a instance where those two things were not the cause ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
Help me on this one (your response)??
I mentioned that the image is in the same folder as the html document. What should I do?
 
you stated it is a jpeg by any chance did you give it a ext. of .jpeg instead of .jpg ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
Thank you so much the path was in correct.
 
Be careful with the filename, especially the extension. Some operating systems hide the file extension, or even omit it altogether. If you're in Windows, right-click it and choose properties to see if it's exactly the way you've specified in your src attribute. Some things to watch out for:

1. File extension, is it .jpg or .jpeg, or have you forgotten to include it.

2. Check for upper & lower case. Some servers are case-sensitive and will differentiate between myfile.jpg and MyFile.jpg

3. Look out for strange charactors in your file name, including *, /, ?, etc. Also avoid spaces.
 
Damn! turn your back on this forum for two minutes and the question is already answered! Sorry about any duplication....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top