• 카테고리

    질문 & 답변
  • 세부 분야

    웹 개발

  • 해결 여부

    미해결

콘솔 txt에러 출력 안되게 하는 방법이 궁금합니다.

19.07.14 21:30 작성 조회수 118

0

function fn_get_data_one(key){
selectedKey = key;
var memoRef = database.ref('memos/'+ userInfo.uid+
'/'+key)
.once('value').then(function(snapshot){
$(".textarea").val(snapshot.val().txt); // 159
});
}
 
function fn_delete_data(key){
if (!confirm('삭제하시겠습니까?')) {
return;
}
var memoRef = database.ref('memos/'+ userInfo.uid+
'/'+key);
memoRef.remove();
$("#"+key).remove();
initMemo();
}
 
///////////////////////////////////////////////////

Uncaught (in promise) TypeError: Cannot

read property 'txt' of null at (index):159

///////////////////////////////////////////////////

강의 너무 잘 듣고 있습니다~
기능에는 문제가 없는데 콘솔창에서
위쪽 부분 $(".textarea").val(snapshot.val().txt);
중 txt 에러라고 나오는데 문제가 뭘까요?

답변 0

답변을 작성해보세요.

답변을 기다리고 있는 질문이에요.
첫번째 답변을 남겨보세요!