Home  >  Article  >  Backend Development  >  IE系列浏览器不能兼容jQuery版的change如何解决,有代码,求指点

IE系列浏览器不能兼容jQuery版的change如何解决,有代码,求指点

WBOY
WBOYOriginal
2016-06-06 20:46:501376browse

<code class="lang-js">jQuery(function(){
  jQuery("#upload").change(function(){
    jQuery('#uploadForm').submit();
  })
})
</code>

在ff 和chrome下都能触发事件,但是IE仍然无动于衷

回复内容:

<code class="lang-js">jQuery(function(){
  jQuery("#upload").change(function(){
    jQuery('#uploadForm').submit();
  })
})
</code>

在ff 和chrome下都能触发事件,但是IE仍然无动于衷

用.on
https://api.jquery.com/on/

<code class="lang-javascript">$("#test").on('change', function() {
    alert('ok');
});
</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn