목록자바스크립트 (347)
투케이2K

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] /* [html 최초 로드 및 이벤트 상시 대기 실시] */ window.onload = function() { console.log(""); console.log("[window onload] : [start]"); console.log(""); // [테스트 함수 호출] testMain(); }; /* [자바스크립트 테스트 코드] */ function testMain(){ console.log(""); console.log("[testMain] : [start]"); console.log(""); /* [요약 설명] 1. Lodash 는 객체, 배열 등의 데이터의 구조를 쉽게 사용할 수 있게해주는 자바..

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] [결과 출력]

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] [결과 출력]

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] [결과 출력]

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] [결과 출력]

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] [결과 출력]

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] /* [html 최초 로드 및 이벤트 상시 대기 실시] */ window.onload = function() { console.log(""); console.log("[window onload] : [start]"); console.log(""); // [테스트 함수 호출] testMain(); }; /* [테스트 함수 수행 실시] */ function testMain(){ console.log(""); console.log("[testMain] : [start]"); console.log(""); /* [요약 설명] 1. Date.now() : 현재 날짜 및 시간 데이터를 타임 스탬프 밀리세컨드 13 자..

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] /* [자바스크립트 테스트 코드] */ function testMain(){ console.log(""); console.log("[testMain] : [start]"); console.log(""); /* [요약 설명] 1. test() 메소드는 인수로 전달된 문자열에 특정 패턴과 일치하는 문자열이 있는지를 검색합니다 2. test() 메소드는 패턴과 일치하는 문자열이 있으면 true를, 없으면 false를 반환합니다 */ // [초기 변수 선언 실시] var strData = "aabbccdd"; // [검색하려는 패턴 지정] var pattern_1 = /abc+/ var pattern_2 = /a..

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] /* [테스트 함수 수행 실시] */ function testMain(){ console.log(""); console.log("[testMain] : [start]"); console.log(""); /* [요약 설명] 1. 이스케이프 (escape) : 아스키문자에 해당하지 않는 문자들은 모두 유니코드 형식으로 변환해 줍니다 (16 진수) 2. 이스케이프 (escape) : 1바트일때 %XX 이며 2바이트 (한글) 일때는 %uXXXX (u 포함) 입니다 3. 언이스케이프 (unescape) : 이스케이프 문자를 디코딩할 때 사용합니다 4. 이스케이프 예시 : hello %uD22C(투) %uCF00(케..

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] // [body 소스 코드] // [자바스크립트 소스 코드] document.getElementById("input_box").focus(); // [포커스 활성] document.getElementById("input_box").blur(); // [포커스 해제] // [모바일 가상 키보드 제어 속성 : inputmode] [1]. 가상 키보드 비활성 [2]. 일반 텍스트 입력 키보드 [3]. 숫자 입력 키보드 [4]. 숫자 입력 키보드 [5]. 전화 번호 입력 키보드 [6]. 검색 키보드 [7]. 이메일 입력 키보드 [8]. 주소 입력 키보드

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] /* [moment 라이브러리 사용해 Date 포맷 출력 실시] */ function time_sysnc(){ console.log(""); console.log("[time_sysnc] : [start]"); console.log(""); // [Date 객체 생성 실시] var date = new Date(); // [현재 날짜 및 시간 학인 실시 : 24 시간 형태] var now24Date = moment(date).format("YYYY-MM-DD HH:mm:ss"); console.log(""); console.log("[now24Date] : " + now24Date); console.log(..

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] /* [셀렉트 박스 컨텐츠 동적 생성 실시] */ function createSelectBoxItem(){ console.log(""); console.log("[createSelectBoxItem] : " + "[start]"); console.log(""); // [1]. [동적으로 아이템을 생성하기 위해 초기 배열 선언 실시] var itemList = new Array(); itemList.push("헬로"); // 특정값 추가 itemList.push("투케이"); // 특정값 추가 itemList.push("TWOK"); // 특정값 추가 // [2]. [createElement 사용해 sele..

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] /* [html 소스 코드] */ 사과 바나나 /* [셀렉트 박스 변경 이벤트 감지] */ var selectNowItem = "1" var selectNowName = "사과" function selectChange(){ console.log(""); console.log("[selectChange] : [start]"); console.log(""); var tagId = document.getElementById("select_item"); // [객체 id 지정] selectNowItem = tagId.options[tagId.selectedIndex].value; // [선택된 value 확인] se..

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] /* [텍스트 전체 복사 수행] */ function copyText(){ console.log(""); console.log("[copyText] : [start]"); console.log(""); try { // [텍스트를 복사할 객체 지정 실시 : P 태그 객체 id 지정] var tagID = document.getElementById("scan_content_p"); // [텍스트 정보를 Range 객체에 저장] var range = document.createRange(); range.selectNode(tagID.childNodes[0]); // [select() 함수를 사용해 전체 영역 지..
[환경 설정 및 설명] 프로그램 : Intellij 설 명 : 모바일 환경에서 drag 드래그 앤 드롭 이벤트가 적용되지 않는 이슈 [에러 원인] 1. Pc 환경에서 적용하는 drag 드래그 앤 드롭 이벤트는 마우스 클릭 이벤트를 기반으로 동작 하지만 모바일 환경에서는 마우스 클릭 이벤트가 없기에 적용되지 않는 이슈 [해결 방법] 1. 모바일 환경에서는 touch 터치 이벤트를 기반으로 드래그 앤 드롭 기능을 커스텀 마이징 구현을 실시 [참고 사이트] https://blog.naver.com/kkh0977/222384269020 26. (html/css/javascript/jquery) 드래그 앤 드롭 (drag and drop) 기능을 사용해 div 속성값 교체 실시 - 브라 /* =..
[환경 설정 및 설명] 프로그램 : Intellij 설 명 : 사파리 브라우저 new Date 사용 시 Invalid Date 이슈 [에러 원인] 1. 사파리는 크롬 브라우저와 다르게 yyyy-mm-dd 형식 포맷을 지원하지 않아서 발생하는 이슈 [해결 방법] 1. 크롬 브라우저 및 사파리 브라우저 접속 분기 처리 > new Date 포맷 형식 지정 실시 - 크롬 브라우저 : new Date('2022-04-11 13:35:00'); - 사파리 브라우저 : new Date('2022/04/11 13:35:00');

[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [소스 코드] // [자바스크립트 사용해 쿠키를 셋팅 하기 위해 형식 정의 실시] var cookies = "document.cookie='" cookies += "JSESSIONID=6245179bad665fcda080087c;domain=m.test.ac.kr;path=/;" cookies += "'" print("") print("===============================") print("[A_ChildWebview >> observeValue() :: 웹뷰 로드 상태 확인]") print("쿠키값 자바스크립트 셋팅 :: ", cookies) print("===============================")..

[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [소스 코드] self.main_webview!.evaluateJavaScript("closeKeypad(\(jsonObj))") { (success, error) in if error != nil { print("") print("===============================") print("[A_Main >> iosToJs_closeKeypad() :: IOS >> 자바스크립트]") print("JS 함수 :: closeKeypad") print("설 명 :: ", "암호화 데이터 전달") print("전송 결과 [error] :: ", error?.localizedDescription) print("==========..

[개발 환경 설정] 개발 툴 : XCODE 개발 언어 : SWIFT [필요 설정] [소스 코드 : 웹뷰 메인] import UIKit // MARK: [웹뷰를 사용하기 위한 import] import WebKit class ViewController: UIViewController , WKNavigationDelegate, WKScriptMessageHandler , WKUIDelegate { // MARK: [클래스 상속 설명] /* 1. WKNavigationDelegate : 웹뷰 실시간 로드 상태 감지 2. WKScriptMessageHandler : 자바스크립트 통신 사용 3. WKUIDelegate : alert 팝업창 이벤트 감지 */ // MARK: [액티비티 메모리 로드 수행 ..

[개발 환경 설정] 개발 툴 : Edit++ 개발 언어 : javascript [소스 코드] /* [JS 요약 설명] 1. window.onload : 브라우저 로드 완료 상태를 나타냅니다 2. location.href : 웹페이지 로드 된 주소 확인 및 새롭게 웹 페이지 주소를 지정할 수 있습니다 3. history.go(0) : 인자값으로 0을 넣으면 location.reload 와 같은 동작을 수행합니다 4. location.reload() : 현재 웹 페이지 새로 고침을 수행합니다 */ /* [html 최초 로드 및 이벤트 상시 대기 실시] */ window.onload = function() { console.log(""); console.log("[window onload] : [sta..