• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

views/sequelize.pug의 form 부분에 action이 없는 이유는 뭔가요?

18.11.08 20:53 작성 조회수 81

0

안녕하세요. 항상 좋은 강좌 잘 듣고 있습니다.

호주 귀국 하루전에 우연히 서점에 들려서 펼처봤는데 내용이 너무 좋아서, 동영상 강좌도 듣고 있습니다.

질문이 있는데 form 에 관한 부분입니다. 제가 기억하기로는 form은 action 부분이 있어야 어디로 보내는지를 설정할 수 있는데 본문의 sequelize.pug에 있는 form에는 action이 들어있지 않네요.

특별한 이유가 있나요?

없어도 처리가 된다면 어떤 원리도 처리가 되나요?

이하는 코드 전문입니다.

doctype html

html

head

meta(charset='utf-8')

title 시퀄라이즈 서버

style.

table {

border: 1px solid black;

border-collapse: collapse;

}

table th, table td {

border: 1px solid black;

}

body

div

form#user-form

fieldset

legend 사용자 등록

div

input#username(type="text" placeholder="이름")

div

input#age(type="number" placeholder="나이")

div

input#married(type="checkbox")

label(for="married") 결혼 여부

button(type="submit") 등록

br

table#user-list

thead

tr

th 아이디

th 이름

th 나이

th 결혼여부

tbody

for user in users

tr

td= user.id

td= user.name

td= user.age

td= user.married ? '기혼' : '미혼'

br

div

form#comment-form

fieldset

legend 댓글 등록

div

input#userid(type="text" placeholder="사용자 아이디")

div

input#comment(type="text" placeholder="댓글")

button(type="submit") 등록

br

table#comment-list

thead

tr

th 아이디

th 작성자

th 댓글

th 수정

th 삭제

tbody

script(src='/sequelize.js')

답변 1

답변을 작성해보세요.

0

ajax 요청의 경우 form action이 필요 없습니다.