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.
Alert Demo & console.log Demo
So, what's happening?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…