채택완료

이해안되는 js 파일 질문 드려요

2020-09-08 (화) 13:30:07 1,914

https://sir.kr/yc5_tip/1659

이 팁을 따라하고 싶은데 정상작동이 되지 않네요

근데 이해가 안되는 부분이 있어서요

 $("#sit_opt_added li").eq(index).find("span.sit_opt_prc").empty().html(""+number_format(String(tmp_price))+"원");

이 부분이  #sit_opt_added을 찾아서 html() 내용을 보여주는건가요?

그리고

            //total += (it_price + price) * qty;
            tmp_price  = (it_price + price) * qty;
            total += tmp_price;

이 부분 말인데요

total += (it_price + price) * qty;

이거나

tmp_price  = (it_price + price) * qty;
total += tmp_price;

이거랑 차이가 있는 부분인가요?

그냥 중간에 명칭 지정만 한 번 더 거친거 아닌가요?

소스를 봐도 이해를 못해서 질문드려요 ㅠㅠ

답변 1개

채택된 답변
+20 포인트

total += (it_price + price) * qty;

이거나

tmp_price  = (it_price + price) * qty;
total += tmp_price;

같습니다.

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