0

View:

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

jQuery:

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

        ...

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

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

wut
  • 328
  • 1
  • 7
  • 19
  • 1
    your button is missing in the html – ztadic91 Feb 13 '18 at 12:17
  • Thank you. I edited the question. – wut Feb 13 '18 at 12:19
  • 2
    Your code works fine in edge: https://jsfiddle.net/m9t49kys/ must be some other errors in your console – Pete Feb 13 '18 at 12:21
  • 1
    check your console for other error, could be that it breaks somewhere before the initialization – ztadic91 Feb 13 '18 at 12:23
  • ERROR 1: SCRIPT5: SCRIPT5: Access denied. jquery.min.js (3,28933) ERROR 2 : CONSOLE1810304: console.memory has not been implemented and returns 0 for all attributes. Use memory profiler to watch memory usage. ERROR 3: CSS3119: No fonts available for @font-face-rule – wut Feb 13 '18 at 12:29

1 Answers1

2

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>
wut
  • 328
  • 1
  • 7
  • 19
  • 2
    So what was the issue? In the question you posted that you were already using that version. – Shikkediel Feb 13 '18 at 19:38
  • 1
    I had installed it. But I was refencing the older version in Header.asax, which was 1.3-something – wut Feb 14 '18 at 07:55