Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 비밀번호검증정규식
- 숫자 3자리(천단위) 마다 콤마 찍기
- php 배열제거
- 유튜브 플레이 리스트 저장
- thumbnail 클래스
- 윈도우 mod_security2
- mod_security2 설치
- modsecurity 설치
- 윈도우 환경 아파치 mod_security2 설치
- javascript
- wsl2 우분투에 docker 설치
- bootstrap modal
- apple push notification service (apns) is changing
- 비밀번호정규식
- VS Code 서버설치
- (using password: YES)" when trying to connect
- 아파치 웹 서버의 정보 숨기기
- html pdf 변환
- httpd.conf 보안 설정
- 파라미터 & 오류
- usb efi 시스템 파티션 삭제
- bootstrap
- 자바스크립트비밀번호검증
- sha-2 root
- usb 삭제
- mariadb upgrade
- postfix 설치
- group_concat 구분자
- php 이미지 url 검증 함수
- PHP 정규식 예제
Archives
- Today
- Total
투덜이 개발자
[Javascript] URL 파라미터 값 가져오기 쿼리스트링 처리하기 본문
반응형
현재의 페이지 URL 및 전체 파라미터 값 가져오기 위해서는
window.location.href
현재 URL 을 제외하고 파라미터값 만 가져오기 위해서는
window.location.search
let aaaa = window.location.href;
let bbbb = window.location.search;
console.log('aaaa : ', aaaa);
console.log('bbbb : ', bbbb);
// aaaa : http://jhshin.adm.soroptimist.or.kr:8900/club_manage/club_introduce_write.php?mode=write&m_menu_code=MM0002&s_menu_code=SM0203&area_code=AR0001&club_seq=1&cit_code=CIT002
// club_introduce.js:50 bbbb : ?mode=write&m_menu_code=MM0002&s_menu_code=SM0203&area_code=AR0001&club_seq=1&cit_code=CIT002
let ci_seq = parseInt(checkData);
const urlParams = new URLSearchParams(window.location.search);
// 파라미터 변경(set())
urlParams.set('mode', 'modify');
// 파라미터 추가(append())
urlParams.append('ci_seq', ci_seq);
// console.log('urlParams : ', urlParams.toString());
location.href = './club_introduce_write.php?' + urlParams.toString();반응형