A
A
abusabir2016-05-22 19:20:10
Android
abusabir, 2016-05-22 19:20:10

How to cross-browser handle the click event on mobile?

I thought that the horrors of cross-browser approvals are long gone, but now, I need to process events on the mobile version of a small site. I find that even "DOMContentLoaded" Android somehow does not perceive. The code

document.addEventListener("DOMContentLoaded", () => this.ready());

in the same chrome it works, the function is called, but not in the Android Browser.
Well, the worst thing is the click event, which I already tried to process both as mouseup and as touchstart / touchend, but it is not caught.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima Pautov, 2016-05-22
@bootd

https://github.com/dperini/ContentLoaded/blob/mast...

R
Rou1997, 2016-05-22
@Rou1997

I don’t understand why you need DOMContentLoaded, why not window.onload, the lambda is also confusing, and click is probably processed incorrectly, in general, I would try jQuery, it’s cross-browser.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question