소개
게시글
질문&답변
length error
해결했습니ㄷ. 감사합니다
- 1
- 5
- 257
질문&답변
length error
여기서 어디쪽의 문제인지 잘 모르겠습니다 html> head> title>그랩마켓title> link href="index.css" type="text/css" rel="stylesheet" /> script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js">script> head> body> div id="header"> div id="header-area"> img src="images/icons/logo.png" /> div> div> div id="body"> div id="banner"> img src="images/banners/banner1.png" /> div> h1>판매되는 상품들h1> div id="product-list">div> div> div id="footer">div> body> script> axios .get( "https://f858de03-8615-4980-9d75-55e70df4ab1d.mock.pstmn.io/products" ) .then(function (result) { console.log("통신결과 : ", result); const products = result.data.products; let productsHtml = " "; for (var i = 0; i products.length; i++) { let product = products[i]; productsHtml = productsHtml + '' + "" + '(사진) + product.imageUrl + '" />' + "" + '' + '' + product.name + "" + '' + product.price + "" + '' + '(사진)' + "" + product.seller + " " + "" + "" + ""; } document.querySelector("#product-list").innerHTML = productsHtml; }) .catch(function (error) { console.log("error 발생 : ", error); }); script> html>
- 1
- 5
- 257