jQuery onclick在浏览器Edge中不起作用 [英] jQuery onclick not working in browser Edge

查看:944
本文介绍了jQuery onclick在浏览器Edge中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看:

<asp:PlaceHolder runat="server" ID="myPlaceHolder">
        <button id="cmdMyButton">ButtonName</button>

jQuery:

$(function () {
        $('body').on('click', "#cmdMyButton", function (e) {
            alert("alertmessage");
        });

        ...

单击按钮cmdMyButton可在Firefox和Chrome中运行,但在Edge中则完全不起作用.我没有在Edge中收到警报.

Clicking the button cmdMyButton works in Firefox and Chrome, but does absolutely nothing in Edge. I do not get the alert in Edge.

我已经尝试过本主题中的所有内容 Microsoft Edge:onclick事件停止工作了吗? 但是对我没有任何作用.我正在使用jQuery 3.3.1

I have tried everything in this topic Microsoft Edge: onclick event stops working? But nothing worked for me. I am using jQuery 3.3.1

推荐答案

通过将jQuery更新到3.3.1来解决

Solved by updating jQuery to 3.3.1

Header.asax:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" ></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/3.3.1/jquery-ui.min.js" ></script>

这篇关于jQuery onclick在浏览器Edge中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆