imported>Bbon
imported>Bbon
4번째 줄: 4번째 줄:
 
     return this.replace(/(^\s*)|(\s*$)/g, '');
 
     return this.replace(/(^\s*)|(\s*$)/g, '');
 
}</syntaxhighlight>
 
}</syntaxhighlight>
 +
===Window.opne() ===
 +
팝업을 열고, 팝업창이 닫힐때 부모창 리로드
 +
<syntaxhighlight lang="javascript">$(window).on('beforeunload', function () {
 +
                opener.location.replace(opener.location.href);
 +
            });</syntaxhighlight>

2014년 1월 13일 (월) 09:08 판

자주 사용하는 함수 구현

trim 구현

String.prototype.trim = function () {
    return this.replace(/(^\s*)|(\s*$)/g, '');
}

Window.opne()

팝업을 열고, 팝업창이 닫힐때 부모창 리로드

$(window).on('beforeunload', function () {
                opener.location.replace(opener.location.href);
            });