커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
console.log(row) 하니까 function이 아니라고 나오네요..
undefined주차
북마크
백*용
댓글
4
추천
0
조회수
8
조회수
8
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


튜터님이 주신 코드스니펫으로 console.log 넣고 그대로 돌렸는데 도구창에선 function이 아니라고 나와서 질문드립니다ㅠㅠ






작성한 코드 및 에러 메세지

<!DOCTYPE html>

<html lang="en">


<head>

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>오늘의 전시</title>

<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js"></script>

<style>

html, body, h1, h2, h3, p, a, span{

padding: 0;

margin: 0;

}

.wrap{

width: 1050px;

margin: auto;

/* background: green; */

}

.card-wrap{

display: flex;

flex-direction: row;

flex-wrap: wrap;

}

.card{

display: flex;

flex-direction: column;

align-items: flex-start;

justify-content: flex-start;

width: 320px;

height: 340px;

margin: 16px 10px;

border: 1px solid #000;

/* background: pink; */

cursor:pointer;

}

.card > span{

margin: 8px;

}

.card-image{

width: 100%;

height: 200px;

background: url('https://i.pinimg.com/originals/cc/c2/a8/ccc2a8f21f271c6562361dee577d7490.jpg');

background-position: center;

background-size: cover;

}

.card-title{

font-size: 18px;

font-weight: bold;

}

.period{

font-size: 14px;

color: red;

}

.tags{

font-size: 14px;

word-break: keep-all;

color: orange;

}

.url-form{

align-items: center;

justify-content: space-around;

}

.plus-form{

align-items: center;

justify-content: center;

cursor: pointer;

}

</style>

<script>

$(document).ready(() => {

listing();

showPlusForm();

})

const showUrlForm = () => {

$('#url-form').show();

$('#plus-form').hide();

}

const showPlusForm = () => {

$('#url-form').hide();

$('#plus-form').show();

}

const posting = () => {

let url = $('#url').val();

let formData = new FormData()

formData.append("url_give", url)

fetch('/exhibit', {method: "POST", body: formData}).then(res => res.json()).then(data => {

alert(data['msg'])

window.location.reload();

})

}

const move = (url) => {

window.open(url,'_blank')

}

const listing = () => {

fetch('/exhibit').then(res => res.json()).then(data => {

let rows = data['result']

rows.forEach((row) => {

console.log(row)

})

})

}

</script>

</head>


<body>

<div class="wrap">

<h1>오늘의 전시</h1>

<div id="card-wrap" class="card-wrap">

<div onclick="move('http://spartacodingclub.kr')" class="card">

<div class="card-image"></div>

<span class="card-title">제목</span>

<span class="period">기간</span>

<span class="tags">#설명회 #설명회 #설명회 #설명회 #설명회 #설명회 #설명회 #설명회 #설명회</span>

</div>

<div id="card-wrap" class="card">

<div class="card-image"></div>

<span class="card-title">제목</span>

<span class="period">기간</span>

<span class="tags">#설명회 #설명회 #설명회 #설명회 #설명회 #설명회 #설명회 #설명회 #설명회</span>

</div>

<div id="card-wrap" class="card">

<div class="card-image"></div>

<span class="card-title">제목</span>

<span class="period">기간</span>

<span class="tags">#설명회 #설명회 #설명회 #설명회 #설명회 #설명회 #설명회 #설명회 #설명회</span>

</div>

<div id="url-form" class="url-form card">

<input type="text" id="url" placeholder="전시 URL을 입력해주세요!">

<div>

<button onclick="showPlusForm()">취소하기</button>

<button onclick="posting()">등록하기</button>

</div>

</div>

<div id="plus-form" onclick="showUrlForm()" class="plus-form card">

<span>+</span>

<span>추가하기</span>

</div>

</div>

</div>

</body>


</html>



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴