I have this tag in my page that runs on localhost:3000 <img id="img1" src="file:///Users/michal/Desktop/Picture 1.png" width="400" height="200">
image do exists but it is not displayed. if i put path from src attribute into address bar image is loaded but it doesn't work in img tag not even in iframe tag. I'm using Safari 4 on Mac. Am I missing something or it is not possible at all? Thanks.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
That's a security feature .. it isn't possible in any browser on any platform.
回答2:
Must be a Safari 4 issue. Seems to work fine on Safari 3.2.1 and Firefox 3.0.10. I use similar thing and it works:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 1 September 2005), see www.w3.org">
<title></title>
</head>
<body>
<img id="img1" src=
"file:///Users/ryan/.../wait.gif"
width="400" height="200" name="img1">
</body>
</html>
I think if you are running localhost:3000, then the above answers are correct with the security. Try using relative path without the file://