egovframework에서 showModalDialog가 크롬에서 적용안될 때 대체 사용 기능을 제공한다.


URL : https://www.egovframe.go.kr/wiki/doku.php?id=egovframework:com:v3:cmm:showmodaldialog


JavaScript의 Modal 방식의 dialog를 지원하는 windows.showModalDialog의 기능이 chrome 37 버전부터 지원하지 않음에 따라 대체 기능을 제공한다.


js파일을 제공하며, 이미 공통 js를 쓰고있는 경우에는 공통 js 코드만 추가해주면 별도의 script 선언없이 공통적용도 가능하다.


▼ 아래는 공통관련 부분 내용이다.


6. 공통 js 파일을 통해 처리하는 경우 js 파일 처리

공통 js를 통해 공통 기능이 제공되는 경우 원 js 파일에 대하여 다음과 처리하면 개별 JSP 파일에 <script>를 추가하실 필요는 없음

다음과 같이 활용할 수 있다.

function dirname(path) {
	if (path.lastIndexOf("/") == -1)
		return "./";
	return path.replace(/\\/g, '/').replace(/\/[^\/]*\/?$/, '') + "/";
}
 
function getActiveScript() {
	var d = document.getElementsByTagName("script");
	var path = dirname(d[d.length - 1].src);
	delete d;
 
	var offset=path.indexOf(location.host)+location.host.length;
	return path.substring(offset);
} 
 
 
function getContextPath(){
    var offset=location.href.indexOf(location.host)+location.host.length;
    var ctxPath=location.href.substring(offset, location.href.indexOf('/',offset+1));
 
    if ((/^\/js/).test(getActiveScript())) {
    	return "";
    }
 
    return ctxPath;
}
 
function loadScript(src, f) {
  var head = document.getElementsByTagName("head")[0];
  var script = document.createElement("script");
  script.src = src;
  var done = false;
  script.onload = script.onreadystatechange = function() { 
    // attach to both events for cross browser finish detection:
    if ( !done && (!this.readyState ||
      this.readyState == "loaded" || this.readyState == "complete") ) {
      done = true;
      if (typeof f == 'function') f();
      // cleans up a little memory:
      script.onload = script.onreadystatechange = null;
      head.removeChild(script);
    }
  };
  head.appendChild(script);
}
 
loadScript(getContextPath() + '/js/egovframework/com/cmm/showModalDialog.js');




문자 > 숫자


Integer.parseInt(ㅇㅇㅇ);



숫자 > 문자

ㅇㅇㅇ.toString();



'JAVA' 카테고리의 다른 글

반복문 for 두가지 방법  (0) 2016.09.20

이클립스에서 주석을 설정 및 해제 하려면

주석하려는 영역 드레그 후


주석 : ctrl + shift + /

해제 : ctrl + shift + \


자꾸 까먹는당....ㅠㅜㅋ 정작 중요할 때 기억 안나니 메모~~


주소에서 지역을 가져올 때나 데이터 중 구분자 값을 기준으로 첫번째 데이터를 가져와야 할 때 유용한 split 처럼 구현한 쿼리


SUBSTR(ADDR1,1,INSTR(ADDR1,' ','1','1')) AS AREA


- INSTR 함수

INSTR(데이터, 구분자, 시작, 구분자 순서)


ex) INSTR(ADDR1,' ','1','1')

ADDR1 컬럼에서 ' '를 구분으로 1번째부터 시작, ' '가 첫번째로 나오는 순서



 그 후 SUBSTR 마지막 부분에 INSTR 데이터를 넣어주면 SPLIT[0] 번째처럼 데이터를 가져올 수 있다.

'SQL > oracle' 카테고리의 다른 글

[ORACLE] 주민번호로 만 나이 구해오기  (0) 2016.09.27

+ Recent posts