为什么可以'tI将IMG元素链接到类似于“;http://en.wikipedia.org/wiki/File:
Why can't I link IMG elements to urls like "http://en.wikipedia.org/wiki/File:Batman_Lee.png"
我使用谷歌自定义搜索来获取图像结果。这是我的第一次测试,当我搜索蝙蝠侠时,我在维基百科上找到了这个URL:"http://en.wikipedia.org/wiki/File:Batman_Lee.png"
当我尝试使用它的图像元素:
<img src="http://en.wikipedia.org/wiki/File:Batman_Lee.png">
我得到了一个空白元素。为什么会这样?维基百科是在积极阻止人们链接到他们的图片,还是有其他原因?
因为您使用的URL是具有图像的维基百科的文件/页面。
绝对图像URL为:
http://upload.wikimedia.org/wikipedia/en/a/a7/Batman_Lee.png
当您在<img>
标记中链接上述URL时,它就会工作。
<img src="http://upload.wikimedia.org/wikipedia/en/a/a7/Batman_Lee.png">
注意:您可以通过在image
上单击鼠标右键并复制URL
来获得上述URL
查看演示
相关文章:
- Meteor如何接收HTTP请求
- 正在将base64 jpeg从input-type=file上传到服务器
- 在我的情况下,如何进行http请求
- //而不是在src=“”上使用http://"属性
- 我无法使用angularJs($http)访问服务器
- AJAX简单错误.XMLHttpRequest无法加载http://localhost/mpl/getPage.php.
- 如何将PHP get查询转换为Meteor's HTTP.get()
- http(localhost或remote)提供的文件是否可以从通过file://protocol打开的本地文件访问?反
- 为什么可以'tI将IMG元素链接到类似于“;http://en.wikipedia.org/wiki/File:
- 当我打开之前下载的网页时,一个 http:// 得到变成了一个 file:/// 得到,为什么
- 如何在 Firefox 11 中查看 http://localhost 提供的页面中的 file:// 图像
- Let file:// access http://localhost
- 警告:file_get_contents(http://..@2x.png)[function.file-get-con
- 为什么在cordova包装的应用程序中,http://请求会变成file:////
- Phonegap - Phonegap是否使用HTTP://或file://
- 当调用外部脚本(如disqus指令)时,如何将angular / ionic中的file://更改为http://
- html文件使用file:///加载,但不使用http://加载
- AngularJS $http.get php file - $injector:modulerr
- 什么是jquery正则表达式来匹配这个字符串“http://path/to/file/file-name-123x123
- 如何使用file:///F:/foldername访问ajax本地文件夹?但它适用于http://.