| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Database
- Container
- numpy
- Mac
- DB
- LLM
- TORCH
- Package
- pytorch
- Linux
- Paper
- docker
- Converting
- Laravel
- pandas
- PostgreSQL
- evaluation
- AI
- GitLab
- Windows
- git
- ubuntu
- 책갈피
- judge
- Python
- Flask
- KAKAO
- list
- file
- format
Archives
- Today
- Total
Daily Develope
[JS] javascript 예시 코드 모음 본문
query를 사용한 개체 검색
xpath에 해당하는 모든 개체들을 불러와 순회하는 예시 코드
검색쿼리는 css selector 문법 사용.
// div 아래 model 이라는 클래스명을 가지는 모든 개체 검색
const modelList = document.querySelectorAll("div.model");
// 검색된 항목에 대한 순회
modelList.forEach(element => {
console.log(element);
});Ajax
Post (Form 데이터 전달)
post 통신으로 form 데이터 전달
var formData = new FormData();
formData.append('data_a', data_a);
formData.append('data_b', data_a);
$.ajax({
url: '/someurl',
type: 'POST',
data: formData,
processData: false,
contentType: false, // 'application/json; charset=utf-8',
success: function(response) {
if (response) {
alert("처리 성공");
} else {
alert("처리 실패 (전달에는 성공했으나 내부로직으로부터 undefined 값 전달 받음)");
}
},
error: function(error) {
alert("처리 중 오류 발생");
}
});
참고
'Develope > Web' 카테고리의 다른 글
| [React] React 및 Next.js 기본 내용 정리 (0) | 2025.11.29 |
|---|---|
| [Web] Datatables 간단 예시 (2) | 2024.09.11 |
| [CSS] 작성 규칙 (0) | 2024.05.02 |
| [SSL] NginX SSL 인증서 설정 (0) | 2023.08.17 |
| [WEB] 동적 웹페이지 처리 with Python (0) | 2023.05.09 |
Comments