본문 바로가기

전체 글245

html a태그 다운로드 download 예제 소스 예제 소스 결과화면 소스 설명 a태그 href="" 에서 다운파일 링크를 확인한다. 서버에 파일 업로드 후 웹 브라우저 url로 파일 존재하는지 체크 download 옵션을 써준다. 2021. 4. 6.
네이버 개발자 센터 로고 변경 시 검수요청 안됨 해결방법 추가 요청 서류를 아무거나 눌렀다가 다시 없음으로 하면 변경을 여부를 다시 체크해서 버튼이 활성화 된다. 2021. 4. 2.
javascript input 배열 유효성검사 예제 item[] model[] sn[] pd[] 4개의 값을 갯수만큼 유효성검사 var index_data=$(\"input[name='item[]']\").length-1; for (let i = 0; i 2021. 4. 2.
script 마지막 형제 찾기 예제 children() last() console.log($('#item_list').children().last()); function delForm() { // console.log(); var length = $('#item_list').children().length; if(length>1){ console.log($('#item_list').children().last()); } } 2021. 4. 2.
.html() tr td 생략됨 before source Yes No Yes No function addForm() { console.log($('#list_file_tag').html()); } 콘솔창에 가 생략됨 after source Yes No Yes No 없이 만 작성할 경우 생기는 문제로 추정 소스에 삽입해줬더니 해결 2021. 4. 2.
php key value array push array push 1차원 배열 같은경우 아래와 같이 배열 요소를 추가할수 있다. array_push($변수명, "apple", "raspberry"); 하지만 key value 로 넣기위해선 아래와 같은 방식을 사용해야한다. $변수명["p.title"] = "제품명"; 2021. 4. 1.
script localStorage 퀵 메뉴 닫힘 펼치기 페이지 이동시 유지 $(document).ready(function() { //토글 함수 function toggleHandle() { $('.quick_menu').toggleClass('type_fold'); } //체크 localStorage 데이터 겟 if (localStorage.getItem('switch-state') && localStorage.getItem('switch-state') === 'true') { toggleHandle(); } //클릭시 토글 처리 localStorage 셋팅 처리 $('.btn_fold').click(function() { let el = $('.quick_menu'); toggleHandle(); localStorage.setItem('switch-state', el.has.. 2021. 3. 31.
구글 마커 안나옴 Error InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama error code Error InvalidValueError: setMap: not an instance of Map; and not an instance of StreetViewPanorama before code function makeGMap(lat,lng,code){ var mapdata="map"+code var latdata=lat var lngdata=lng var myLatLng = { lat:latdata, lng:lngdata }; var mapcode = new google.maps.Map(document.getElementById("map"+code), { zoom: 16, center: myLatLng }); var markercode = new google.maps.Marker.. 2021. 3. 31.
php curl header 사용 예시 비즈엠 내 잔액 확인 api function get($url, $params=array()){ $url = $url.'?'.http_build_query($params, '', '&'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); return $response; } function getMyPoint() { return $this->get('ht.. 2021. 3. 29.
페이지 접속시 자동으로 탭 클릭하고 지정 영역으로 스크롤 이동 $( document ).ready(function() { $('#prdReview2').trigger("click"); setTimeout(function() { var location = document.querySelector("#shopTab").offsetTop; window.scrollTo({top:location, behavior:'smooth'}); }, 700); }); () () 2021. 3. 11.
facebook 링크 공유 javascript 예제 소스 2021. 2. 26.
php file('abc.txt'); text파일을 라인별 배열로 읽어오는 기능 예제 필요 파일) data.txt hello world good morning 실행소스) _DIR = 'public_html/data'; $f = file(_DIR.'/data.txt'); 결과 화면) var_dump( $f ); # array(2) { # [0]=> # string(12) "hello world # " # [1]=> # string(13) "good morning # " # } 응용) 배열을 다시 라인으로 변경 if ($f != null){ for($i = 0;$i < count($f);$i++){ $arrData['list'] .= $f[$i]; } } 2021. 2. 23.