HTML :catch되지 않은 ReferenceError가
<div id="myID" onclick="cc(this.id)">Click Here</div>
자바 스크립트 :
var timer;
var firing = false;
var begen = function(id) {
alert('tek');
};
var popupAc = function(id) {
alert('çift');
};
function cc(id) {
if (firing) {
popupAc(id);
clearTimeout(timer);
firing = false;
return;
}
firing = true;
timer = setTimeout(function() {
//begen(id);
clearTimeout(timer);
firing = false;
}, 250);
}
오류 :
Uncaught ReferenceError: cc is not defined
예 : http://jsfiddle.net/LXSZj/3/
http://jsfiddle.net/LXSZj/6/ – fcalderan