Jquery中文网 www.jquerycn.cn
Jquery中文网 >  jQuery  >  jquery 教程  >  正文 jquery(live)中File input的change方法只起一次作用的解决办法

jquery(live)中File input的change方法只起一次作用的解决办法

发布时间:2013-06-13   编辑:www.jquerycn.cn
jquery中File input的change方法只起一次作用的解决办法,需要的朋友可以参考下。
jquery中File input的change方法只起一次作用的解决办法,需要的朋友可以参考下。 错误写法
复制代码 代码如下:

$("#uploadImg").click(function(){
  do something
});

正确写法
复制代码 代码如下:

$("#uploadImg").live('change',function(){
do something
});

您可能感兴趣的文章:
jquery(live)中File input的change方法只起一次作用的解决办法
浅析jquery某一元素重复绑定的问题
jQuery【事件】问题
解析jQuery的三种bind/One/Live事件绑定使用方法
jquery live()重复绑定的解决方法介绍
jQuery中live方法的重复绑定说明
深入理解jQuery中live与bind方法的区别
jQuery 2.0.3 源码分析 事件绑定 – bind/live/delegate/on
jQuery live
jQuery live( type, fn ) 委派事件实现

[关闭]