채택완료

자바스크립트 그레이드 질문

2021-09-25 (토) 04:10:26 2,053

답변 1개 / 댓글 2개

채택된 답변
+20 포인트
Copy
<script>
        funtion calcWeight(tot) {
           var result = tot -  <?php echo number_format($weight, 0) ?>;
           return result;
        }
        document.write("현재 동일한 배송비로 "); document.write(calcWeight(500)); document.write("g 더 주문할수 있습니다.");
        
    </script>

답변에 대한 댓글 2개

말씀해준대로 처리하면 정상적으로 출력되지않고 오류가 발생합니다
Uncaught SyntaxError: Unexpected identifier
조건문 으로 구간만들어서 해결했습니다 감사합니다

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