解决IE下file input的onchange事件监听问题
代码示例
<!doctype html> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <input type="file" /> <script> var $ = window.jQuery; function filechange(){ alert(this.value); } $(function(){ //IE support this if('onpropertychange' in document.documentElement){ $('input').bind('propertychange', filechange); }else{ $('input').bind('change', filechange); } }) </script>


浙公网安备 33010602011771号