<img src='' /> 当Img 标签有空的src属性时

当Img 标签有空的src属性时(即<img src='' />)时,Chrome Version : 4.0.249.89 (38071)

URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 4: FAIL
  Firefox 3.x: FAIL (3.5 fixed <img> only)
         IE 7: FAIL (<script>, <link> don't cause requests, <img> does)
         IE 8: FAIL (<script>, <link> don't cause requests, <img> does)
     Opera 10: OK

What steps will reproduce the problem?
1. Place <img src="">, or <script src="">, or <link rel="stylesheet"
href=""> into a page.
2. Load the page in Chromium while monitoring HTTP traffic.


What is the expected result?

There should be only one request to the page.

可能会建立新链接或使

http://stackoverflow.com/questions/3483402/aware-of-img-tags-with-empty-src-in-chrome

io多打开几次;

https://code.google.com/p/chromium/issues/detail?id=38144

综上:

src最好赋值为(//:0和javascript:void(0))

refer||[http://stackoverflow.com/questions/5775469/whats-the-valid-way-to-include-an-image-with-no-src]

 

备注:void 0 ===undefined(会执行表达式getValue(),但返回值是undefined!)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值