jimjim
jimjim

Reputation: 2503

Google Chrome Browser does not display the images from Local network or local host?

Edit :

in the html source I have thigs like :

<img src="./images/someimage.jpg" />

This displays fine IE/FireFox would display the images coming from URL's like "http://mypc" or "http://localhost" or ip adress on the netwrok , google chrome on Galaxy, Windows Machine, or google Android will not display the images.

After having burned too many hours trying various CSS, image src tag, html document description tricks, I have given up.

During my search I found (and lost) the link to chrome forums regarding this issue that seemed to say it is just so by users.

Anyone has any more information on weather it is possible to view images on local host/computer name on netwrok or ip adress?

Upvotes: 2

Views: 4358

Answers (2)

m3z
m3z

Reputation: 990

From your comment above (where you say if you put h11p://mycomputer/images/image1.jpg it works) and your question (where you put image URL of ./images/someimage.jpg), my guess is that you have a problem with the relativeness (lacking a better word) of your URLs.

E.G.

if your page is at h11p://mycomputer/folder/page.html and you use the relative URL ./images/image1.jpg to source the image then your browser will look in h11p://mycomputer/folder/images/image1.jpg to find that image.

This can also happen with URLs that have been rewritten to include additional slashes.

Solutions are to use either a url that is absolute on the site e.g. /images/image1.jpg (omitting the leading .) or to use a URL that is absolute to the host e.g. h11p://mycomputer/images/image1.jpg

The first solution is preferable because it will continue to work when you change the host-name/domain-name of the site.

** read http where I write h11p

Upvotes: 1

PinoyCoder
PinoyCoder

Reputation: 1112

try using http://localhost/resouce.jpg instead of http:/localhost/resouce.jpg

Upvotes: 1

Related Questions