`
yutian2211
  • 浏览: 24497 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

JQuery(1.4.2)one绑定到input:file的bug

阅读更多
如果用1.4.2 one来绑定事件到input file上,就会报错,在IE7下面,但是,在firefox下面没有这样问题,万恶的IE啊。。。。这里记录一下,备忘……

测试代码:
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.2.js"></script>
<script language="javascript">
  //alert($.fn.jquery);
  var i = 1;
  $(function(){
    $("#mainForm :input").one("change",function(){
      //alert(i);
      $("#test1").html(i);
      i++;
    });
  });

</script>
</head>
<body>
<form method="post" id="mainForm"  >
<input type="file" size="80"  id="file_BP" name="file_BP"  />
</form>
<div id="test1"></div>
</body>
</html>


刚测试了一下最新的1.4.4,没有问题,原来官方已经fix 这个bug了!~~~
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics