34
rated 0 times
[
38]
[
4]
/ answers: 1 / hits: 5357
/ 10 Years ago, sun, march 30, 2014, 12:00:00
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?
More From » alert