1

I have an anchor tag that is marked runat="server" and has a Handles save.ServerClick event attached to it. I'm trying to modify the contents of the tag after it is clicked with jQuery, but it should not interfere with the postback to the server-side Handle.

The iOS version of Safari (specifically I'm testing on iOS 8.4) will trigger the postback correctly, but the html contents of the anchor tag are not updated after I click the button. This problem is not present in the iOS version of Google Chrome or any desktop browser that I have tried.

What's interesting though, is that I put an alert() inside the .click() jQuery handler, and Safari does show the alert box; it simply does not appear to update the anchor tag with the .html() method (maybe a reflow is not triggered if loading a new page / submitting the form?), like what happens in Chrome and desktop browsers. Is there a way to make it update the anchor tag?


Html Anchor Tag:

<a id="save" runat="server" clientidmode="Static">Save Changes</a>

jQuery:

$("a#save").click(function () {
    $(this).html("Saving... <i class='fa fa-circle-o-notch fa-spin'></i>");
});
Chad
  • 1,531
  • 3
  • 20
  • 46

1 Answers1

0

It seems like jQuery.click() have some troubles working on iOS, but there are ways to fix this, you can try either

or

  • Adding cursor: pointer to the style/css of the element

    As posted in this other SO answer by Ravi Gadag adding this rule can also work for you

Hope it helps

Community
  • 1
  • 1
Enrique Zavaleta
  • 2,098
  • 3
  • 21
  • 29
  • 1
    As I stated in my question, the click event _does_ fire. I added an alert and that showed fine. It's just the .html() that does not appear to update on the site in Safari on iOS. The .html() works as expected in Chrome on iOS. – Chad Oct 28 '15 at 21:35