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

WBOY
Release: 2016-06-06 20:46:50
Original
1375 people have browsed it

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

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

回复内容:

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

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

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

<code class="lang-javascript">$("#test").on('change', function() {
    alert('ok');
});
</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template