论坛首页 Web前端技术论坛

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

浏览 1769 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2011-01-18  
如果用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了!~~~
论坛首页 Web前端技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics