(某些)Internet Explorers

时间:2017-07-25 09:56:17

标签: javascript jquery html internet-explorer internet-explorer-11

我在按钮元素上的jquery-click-Events上遇到问题,但在某些Internet Explorer中没有触发。

这与提交表单无关,我发现很多关于此问题的问题,但这个问题没有重复。

我做了一个非常简单的例子来说明问题:

它只是一个测试按钮,最初用红色表示jQuery是有效的,并且点击处理程序将其着色为蓝色并显示警告。 这是我的jQuery代码:

$('#foo').on('click', function(){
  $('#foo').css('color', 'blue');
  alert('test');
}).css('color', 'red');

这是我的HTML代码:

<html>
  <body>
    <button id="foo">Test</button>
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  </body>
</html>

问题是,在Internet Explorer中的某些PC上不会触发click事件。在其他PC上,它适用于IE和所有其他浏览器中的所有PC。

这是一个不工作的IE的截图: not working example

我搜索了所有选项和兼容模式,但未找到解决方法/原因。

想点什么?

0 个答案:

没有答案