1. 전화번호형식 적용법
var regExpPhone = /^\d{2,4}-\d{3,4}-\d{4}$/;
if(!regExpPhone.test(phone)){
alert("전화번호 형식이 올바르지 않습니다.");
return false;
}
2.ajax GET 형식
$.ajax({
type: "GET",
url: "/order",
data: {},
success: function (response) {
console.log(response)
})
3.ajax POST형식
$.ajax({
type: "POST",
url: "/order",
data: {name_give: name, count_give: count, address_give: address, phone_give: phone},
success: function (response) {
if (response["result"] == "success") {
alert(response["msg"]);
// 윈도우 리로드
window.location.reload();
}
}
})
LIST
'4차산업혁명의 일꾼 > 웹개발' 카테고리의 다른 글
docker 1주차 개발일지 (0) | 2021.08.24 |
---|---|
스파르타코딩 웹개발 5주차 (0) | 2021.08.19 |
스파르타코딩 웹개발 3주차 (0) | 2021.08.17 |
스파르타 코딩 웹개발 2주차 과정 (0) | 2021.08.17 |
스파르타코딩 1주차 웹개발일지 (0) | 2021.08.16 |