728x90
반응형

Front/JS & jQuery 307

[js] redirect 사용하기

페이지에 토큰인증을 받지않고, url로 바로 접속 했을 때, 로그인 페이지로 이동 => 로그인을 하면 접속하려했던 url로 이동시키는 기능 구현하려고 한다.1. url로 접속했을 때const _rollback = () => { // 현재 페이지의 URL을 가져옴 const currentPageUrl = window.location.href; // 만약 직접 로그인 페이지로 접근했다면 이전 페이지의 URL을 전달하지 않음 if (!currentPageUrl.includes("/login/")) { // 로그인 페이지로 리다이렉트할 때 이전 페이지의 URL을 쿼리 문자열에 포함시켜 전달 const loginUrl = "/login/?redirect=" +..

[js] window.location.search

https://hihiha2.tistory.com/162 window.location ( Web API란? / pathname, search, hash ... )Web APIs에는 종류가 정말 많은데 오늘은 그 중 window.locaion에 대해 공부했다. 우선 window.location을 이해하기 위해서는 Web APIs가 무엇인지 이해하는 것이 필요하다. 🧷선행학습 web API란? 우선 mdn의 공hihiha2.tistory.comlocation.search'?'URL의 매개변수 또는 "쿼리문자열" 뒤에 오는 문자열

Front/JS & jQuery 2024.05.16

[js][Bootstrap] multiselect의 width를 option값에 따라 설정하기

function adjustMultiselectWidth(multiselect) { var maxOptionWidth = 0; // 모든 옵션의 너비를 비교하여 최대 너비를 계산합니다. $(multiselect).find('option').each(function() { var optionWidth = $(this).text().length * 8; // 폰트 크기와 관련된 값을 조정하여 옵션 텍스트의 길이에 따른 예상 너비를 계산합니다. if (optionWidth > maxOptionWidth) { maxOptionWidth = optionWidth; } }); // 최대 너비를 멀티셀렉트에 적용합니다. ..

Front/JS & jQuery 2024.05.12

[jQuery] 선택자(selector) 확장검색

https://jang8584.tistory.com/221'aaa' 란 name 접근 $("input[name^='aaa']") =>'aaa' 로 시작하는 name 접근 DB에서 like 'aaa%' 와 동일 $("input[name*='aaa'" data-og-host="jang8584.tistory.com" data-og-source-url="https://jang8584.tistory.com/221" data-og-url="https://jang8584.tistory.com/221" data-og-image="https://scrap.kakaocdn.net/dn/HfBhe/hyV2DGI5ns/LgPKZY52dR3WNGLbKPyZ0K/img.png?width=800&height=800&face=0_0..

Front/JS & jQuery 2024.05.10

[js][datatables] td안에 bootstrap multiselect 넣기

안에 multiselect 를 넣어서 만드려고 하는데, 요소바깥에는 multiselect의 dropdown menu가 숨겨지는 현상이 발생하였다. 해결방법은 부모요소에 CSS설정을 해주는 것이다.div.multiselect-parent { position: relative; /* 부모 요소를 relative 포지션으로 설정합니다. */ overflow: visible; /* 부모 요소의 내용이 벗어난 부분을 숨기지 않습니다. */}

Front/JS & jQuery 2024.05.05

[js][Echarts] Click event, 클릭한 차트의 Id 구하기

echart 클릭 이벤트로 클린한 차트의 id 구하기myChart.on('click', function(params) { var chartId = params['event']['target']['id']; console.log("Clicked chart ID: ", chartId);}); 그런데, 이것은 차트영역 div의 id 속성이 아니라, echarts에서 지정한 차트 요소 각각의 id여서, 원한값이 아니었고, var chartContainerId = 'chartContainer';var chartContainer = document.getElementById(chartContainerId);var myChart = echarts.init(chartContainer);chartContain..

Front/JS & jQuery 2024.05.04
728x90
반응형