본문 바로가기
목차
JQuery

Uncaught TypeError: $(...).each(...).done is not a function

by 지각생 2022. 2. 22.
728x90

해결

.done부분 괄호를 제대로 못 닫고 엉뚱하게 닫아서 유발됨.

 


Uncaught TypeError: $(...).each(...).done is not a function

 

  deleteById: function () {
    //let id = $("#id").val(); 아래 data부분 없애고 이렇게만 넣으면 - (1/3)

    $("input[name=no]:checked").each(function () {
      var no = $(this).attr("value");
      console.log(no);

      $.ajax({
        type: "DELETE",
        url: "/index/board/detail/" + no,
        data: JSON.stringify(no),
      })
        .done(function (resp) {
          location.reload;
        })
        .fail(function (error) {
          alert(JSON.stringify(error));
        });
    });
  },
728x90

댓글