미채택 완료

return false

Copy
if (document.getElementById("od_settle_card")) {
        if (document.getElementById("od_settle_card").checked) {
            if (tot_price < 1000) {
                alert("신용카드는 1000원 이상 결제가 가능합니다.");
                return false;
            }
        }
    }

 

이런식으로 이벤트를 발생시키는데 return false 되고 나서 spinner가 보여져서 spinner 을 display none 시키고 싶습니다.

return false 뒤에 이벤트를 발생시키는 방법이나 return false 이 실행됬음을 받아오는 값이 있나요?

|

답변 3개

function aaa() {
    if (document.getElementById("od_settle_card")) {
        if (document.getElementById("od_settle_card").checked) {
            if (tot_price < 1000) {
                alert("신용카드는 1000원 이상 결제가 가능합니다.");
                return false;
            }
        }
  }
  
  return true;

}


if (aaa() == false) {
  alert('false');
}

alert다음에

spinner를 display;none으로 바꾸면 되지 않나요?

그냥 해당 위에 실행하고 싶으신 것들을 실행하시면 되지 않을까요? 특별히 해당 이벤트를 체크하셔야 하는 이유가 있으신건가요?

답변을 작성하려면 로그인이 필요합니다.