IMG标记路径Chrome和Firefox不工作 [英] Img tag path not working in chrome and firefox

查看:181
本文介绍了IMG标记路径Chrome和Firefox不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MVC3剃须刀,我想从本地驱动器进行测试的目的加载图像。

I am using MVC3 Razor and I want to load an image from the local drive for the testing purpose.

我写的img标签,如:

I wrote the img tag like:

<img id="ImgEmployee" src="file://D:/Photos/14.jpg" alt="Employee" />

它正在与IE浏览器。但在Chrome和Firefox这是没有得到加载。

It is working with IE. But in Chrome and Firefox it is not getting loaded.

如何设置的img从本地驱动器加载图像,并在所有浏览器标签的路径?

How to set the path for img tag which loads the image from the local drive and works in all browsers?

推荐答案

Chrome和Firefox预计3 / 字符:

Chrome and FireFox expect 3 / characters:

<img id="ImgEmployee" src="file:///D:/Photos/14.jpg" alt="Employee" />

<击>如果你把只有1 / 他们应该能够猜到,但如果你把二会想你的意思2。

If you put only 1 / they should be able to guess, but if you put 2 it'll think you mean 2.

如果你省略了文件:/// 浏览器会猜测这是该协议

If you omit the file:/// the browsers will guess that is the protocol.

这篇关于IMG标记路径Chrome和Firefox不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆