์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- docker compose
- ์๋ฐ
- redis ํ ์คํธ์ฝ๋
- ํ๋ก๊ทธ๋๋จธ์ค ์ปฌ๋ฌ๋ง๋ถ
- ํ์ดํผ๋ฐ์ด์
- s3 log ์ ์ฅ
- Entity
- aws saa ํฉ๊ฒฉ
- ์ ํจ์ค ์ค์ผ์ค๋ฌ
- ๋ค์ค ์ปจํ ์ด๋
- JPA
- ์คํํ๋ ๋ฏธ์ค
- ํ๋ก๊ทธ๋๋จธ์ค
- prod docker-compose
- ํ๋ก๊ทธ๋๋จธ์ค ํฉ์นํ์์๊ธ
- nGrinder
- ์๋ฒ ํฐ์ง๋ ๋์ปค ์ฌ์คํ
- docker
- docker-compose kafka
- docker ps -a
- redis ์กฐํ
- jvm ๋ฐ๋ฐ๋ฅ๊น์ง ํํค์น๊ธฐ
- ์ ํจ์ค ๋น๋ ์ค๋ฅ
- s3 ์ด๋ฏธ์ง ์ ์ฅ
- Codedeploy ์ค๋ฅ
- aws ์ฟ ํฐ
- private subnet ec2 ๋ก์ปฌ ์ ์
- s3 ์ด๋ฏธ์ง ๋ค์ด๋ก๋
- AWS Certified Solutions Architect - Associate
- Kafka
- Today
- Total
๐๐ข๐๐ โ๐๐๐ ๐๐๐ก๐๐ ๐๐๐๐โง
[JavaScript] Ajax๋ฅผ ํ์ฉํ ๋ฒํผ ๊ฐ ๋๊ธฐ๊ธฐ ๋ณธ๋ฌธ
[JavaScript] Ajax๋ฅผ ํ์ฉํ ๋ฒํผ ๊ฐ ๋๊ธฐ๊ธฐ
๐คRyusun๐ค 2023. 1. 23. 16:23ajax๋ฅผ ํ์ฉํ์ฌ ๋ฒํผ์ ๋ง๋ ํ ๋ณ๊ฒฝ๋ ์ฝ๋๋ก ์ธํด ๋ฒํผ์ด ์ ๋๋ฌ์ง๋ ํ์์ด ์๊ฒผ์์ต๋๋คใ ....
์๋ก ์ฌ๋ฌ๊ฐ์ ๋ฒํผ์ด ๋ง๋ฆ์ผ๋ก์จ ์๋์ class ๊ฐ์ queryselectAll๋ก ์ธ์์ด ์ ๋๋ ์ด์ ์๋๋ฐ
์ฝ์ง์ ํ๋ฃจ๋์ ํํ ํด๊ฒฐ๋ฒ์ ์ฐพ์์ ๊ณต์ ํฉ๋๋ค^.ใ
์ ์ ์ฝ๋
const reserveTimeWant = document.querySelectorAll('.reserve-time-want');
reserveTimeWant.forEach(list => {
list.addEventListener('click', function() {
const reserveTimeActive = document.querySelectorAll('.reserve-time-active');
reserveTimeActive.forEach(li => {
li.classList.remove('reserve-time-active');
});
console.log('reserve-time-active');
list.classList.add('reserve-time-active');
console.log(list.innerHTML);
inputRunningTime.value = list.innerHTML;
});
});
ajax๋ฅผ ํ์ฉํ๋ฉด ์๋ก ๋ง๋ค์ด์ง ๋ฒํผ์ class๊ฐ์ queryselectAll๊ฐ ์ธ์์ ๋ชปํ๊ฒ ๋ฉ๋๋ค.
ํด๊ฒฐ๋ฒ์ ๊ฐ๋จํ๋ฐ ๋ฒํผ์ด ํ๋๋ผ๋ฉด
$(document).on('click', 'class or id๊ฐ', function() {
์ ์ฝ๋๋ก ํด๊ฒฐ์ด ๊ฐ๋ฅํ๋ฉฐ ์๋ก ์๊ธด ๋ฒํผ์ด ์ฌ๋ฌ ๊ฐ์ด๋ฉด
$(document).on('click', '.reserve-time-want', function() {
$(this).each(function(){
$(this).each(function() {
์ฝ๋๋ฅผ ์ถ๊ฐํจ์ผ๋ก์จ ๋ฒํผ์ ๋๋ฅผ ๋ ๊ฐ๊ฐ์ ๊ฐ๋ค์ ๋๊ธฐ๊ฒ ๋ฉ๋๋ค.
๋ณ๊ฒฝํ ์ฝ๋
$(document).on('click', '.reserve-time-want', function() {
$(this).each(function(){
const reserveTimeActive = document.querySelectorAll('.reserve-time-active');
reserveTimeActive.forEach(li => {
li.classList.remove('reserve-time-active');
});
this.classList.add('reserve-time-active');
console.log(this.innerHTML);
inputRunningTime.value = this.innerHTML;
});
});