출처: https://bumcrush.tistory.com/182 [맑음때때로 여름]

 

1) 윈도우 객체확인

 

        var output = '';
        for (var key in window) {
            output += '[' + key + '] : ' + window[key] + '<br><br>';

        }

        window.onload = function() {
            document.body.innerHTML = output;
        };
        //console.log(window);

 

2) 네이버 창이 정해진 사이즈로 열리고, 글씨를 클릭하면 닫힌다.

open(URL, name, features, replace)

 

        window.onload = function() {
            //윈도우생성
            window.open();
            window.open('http://naver.com', 'newWin',
                'width=600, height=300', true);
            var child = window.open('', 'child', 'width=300, height=200');

            child.document.write('<h1 onclick="self.close();">From Parent window</h1>');
        };

 

3) 여러가지 객체 확인

        window.onload = function() {
            // 스크린객체
            // f12 누르고 보면 가로세로 길이 이런거나옴
            console.log(screen);
            // 로케이션 객체 확인
            console.log(location);           
            // 네비게이터 객체 확인
            console.log(navigator);
    
        };

 

+ Recent posts