Tôi gặp sự cố với một ứng dụng di động JQuery đơn giản. Tất cả điều này sẽ được ghi lại thành nhấp chuột của sự kiện nhấp hai lần.sự kiện nhấp chuột trên thiết bị di động jquery kích hoạt hai lần
Không có giải pháp cho vấn đề tương tự đã giải quyết vấn đề này.
Sự cố xảy ra khi triển khai thiết bị hoặc hiển thị trong trình duyệt.
Dưới đây là đoạn code
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<script src="jquery-1.8.2.min.js" type="text/javascript"></script>
<script src="jquery.mobile-1.2.0.min.js" type="text/javascript"></script>
<script src="cordova-2.2.0.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).bind("mobileinit", function() {
$.support.cors = true;
$.mobile.allowCrossDomainPages = true;
});
</script>
<link rel="Stylesheet" href="jquery.mobile-1.2.0.min.css" />
<div>
<input type="button" id="ButtonSubmit" value="Save" />
</div>
<script type="text/javascript">
$("#ButtonSubmit").click(function() {
alert('Clicked');
});
</script>
Câu trả lời chiến thắng ở đây đã hiệu quả đối với tôi: https://stackoverflow.com/questions/12052132/jquery-mobile-click-event-binding-twice – DOK