When we use alert()
, some times the code breaks.
For example:
HTML:
<span>Hi</span>
Javascript:
$(document).ready(function () {
$("span").dblclick(function () {
alert("b");
});
$("span").click(function () {
alert("a");
});
});
The alert("b")
doesn't even show up.
But if we change both the alert()
to console.log
, it is logged.
So, what's happening?
See Question&Answers more detail:os