인프런 커뮤니티 질문&답변
콘솔 txt에러 출력 안되게 하는 방법이 궁금합니다.
작성
·
253
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 에러라고 나오는데 문제가 뭘까요?
답변
답변을 기다리고 있는 질문이에요
첫번째 답변을 남겨보세요!





