Blog
I Hate Web Browsers
Date: 19/11/2004
Imagine your proofing some HTML with images on your hard disk before putting them online. Seems like a reasonable thing to do right? And you want to use images in your HTML, still all good. So you put the images in the same directory as the HTML and try some code like this:
<img src='image.jpg'>
But it doesn't work does it. Noooooooo.
<img src='./image.jpg'>
Nope.
<img src='file:///image.jpg'>
Nah mate.
<img src='file:///./image.jpg'>
Sorry...
<img src='file:image.jpg'>
Wrong again.

*mutter*

Yes both IE and Firefox fail this simplest of tests. Truely I am amazed. How did this happen?
Comments:
SnappyCrunch
19/11/2004 3:15pm
Well, my copies of Mozilla 1.7.1 and IE6 SP2 both display the first two of those image tags just fine, even with no other HTML formatting in the file. Neither can handle the last three, though.
tozz
23/11/2004 11:19pm
you should use " " in html, never ' '
fret
23/11/2004 11:25pm
But ' always seems to work just as well. I doubt that this is why the browsers won't load the images.
netean
24/11/2004 2:58pm
hmmm. should work.. are you browsing through a local web server or just via directly opening up the html..

for me. firefox 1 (and IIS) the code works fine for me. (windows) - are you trying via linux or windows or doesn't it matter?

so... is the image correctly formatted (i.e. it IS definately a JPEG?)
have you tried specifying height and width etc (i.e. a properly defined tag?) does that make any difference?

what kind of dtd are you using.. are you coding to xhtml standards? if so you might need to have


...just my tuppence worth.
fret
29/11/2004 11:00pm
This magically worked some time later on a different windows box. Hmmmm. I'm completely stumped... why? why not all the time? why?
Justin Heiner
30/11/2004 3:45am
Worked fine for me on XP SP2...

My only thought is some strange "security" setting.
 
Reply
From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]