Page 575 - Nodejs 교과서 개정2판
P. 575

window.onload	=	()	=>	{
           						if	(new	URL(location.href).searchParams.get('joinError'))	{
           								alert(new	URL(location.href).searchParams.get('joinError'));
           						}
           				};
           		</script>
           {%	endblock	%}




         ࢚ಿਸ স۽٘ೞח ಕ੉૑ੋ HPPE IUNM ౵ੌਸ ੘ࢿ೤פ׮  formীࢲ ੉޷૑ স۽٘ #good-photo ب ೧ঠ ೞ

         ޲۽ form కӒ੄ enctypeਸ multipart/form-EBUB۽ فয ಬ ؘ੉ఠܳ ࢎਊೞب۾ ࢸ੿೮णפ׮

          views/good.html
           {%	extends	'layout.html'	%}


           {%	block	content	%}
           		<div	class="timeline">
           				<form	action="/good"	id="good-form"	method="post"	enctype="multipart/form-data">
           						<div	class="input-group">
           								<label	for="good-name">상품명</label>
           								<input	type="text"	id="good-name"	name="name"	required	autofocus>
           						</div>
           						<div	class="input-group">
           								<label	for="good-photo">상품	사진</label>
           								<input	type="file"	id="good-photo"	name="img"	required>
           						</div>
           						<div	class="input-group">
           								<label	for="good-price">시작	가격</label>
           								<input	type="number"	id="good-price"	name="price"	required>
           						</div>
           						<button	id="join-btn"	class="btn"	type="submit">상품	등록</button>
           				</form>
           		</div>
           {%	endblock	%}




          public/main.css

           *	{	box-sizing:	border-box;	}
           html,	body	{	margin:	0;	padding:	0;	height:	100%;	}
           .btn	{
           		display:	inline-block;
           		padding:	0	5px;
           		text-decoration:	none;
           		cursor:	pointer;
   570   571   572   573   574   575   576   577   578   579   580