'HTML 참고서'에 해당되는 글 29건

console.dir(navigator);
// 프로포티의 내용을 볼 수 있음 사전임 그냥

console.dir(navigator.appName);
// 'Netscape' 어플의 이름임 

console.dir(navigator.appVersion);
// 엡의 정보들이 나옴

console.dir(navigator.userAgent);
// 브라우져가 서버의 네트워크로 접속할떼 유저 에이전드가 무었인지 알고 싶을때

navigator.platform;
// 'win32' 실행 환경?

 

###기능테스트 없으면 넣어줌

// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
if (!Object.keys) {
  Object.keys = (function () {
    'use strict';
    var hasOwnProperty = Object.prototype.hasOwnProperty,
        hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
        dontEnums = [
          'toString',
          'toLocaleString',
          'valueOf',
          'hasOwnProperty',
          'isPrototypeOf',
          'propertyIsEnumerable',
          'constructor'
        ],
        dontEnumsLength = dontEnums.length;
 
    return function (obj) {
      if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
        throw new TypeError('Object.keys called on non-object');
      }
 
      var result = [], prop, i;
 
      for (prop in obj) {
        if (hasOwnProperty.call(obj, prop)) {
          result.push(prop);
        }
      }
 
      if (hasDontEnumBug) {
        for (i = 0; i < dontEnumsLength; i++) {
          if (hasOwnProperty.call(obj, dontEnums[i])) {
            result.push(dontEnums[i]);
          }
        }
      }
      return result;
    };
  }());
}

'HTML 참고서 > HTML 생활코딩 Youtube' 카테고리의 다른 글

8. JavaScript 제어대상 찾기  (0) 2020.04.12
7. JavaScript 창제어  (0) 2020.04.12
5.JavaScript Location  (0) 2020.04.12
4.Javascript 객체  (0) 2020.04.10
3. JavaScript 사용자와 커뮤니케이션  (0) 2020.04.10
블로그 이미지

Or71nH

,

### 주소 가져오기 href

<!DOCTYPE html>
<html>
<head>
</head>
<body>
	<script type="text/javascript">
    	console.log(location.toString(), location.href);
    </script>
</body>
</html>

### 링크의 분석을 해보자

console.log(location);
// 출력 : https://opentutorials.org/module/904/6634?id=10#bookmark

console.log(
	location.protocol, // 'http:' 이게 프로트콜
	location.host, // 'opentutorials.org' 이거
    location.port, // '8080' 도매인 뒤에 있음 
    location.pathname,  // 'module/904/6634' 구체적인 위치
    location.search, // '?id=10' 
    location.hash // '#bookmark'  
    )

###  리로딩 

location.href = 'http://egoing.net';
// 이곳으로 보넴

location.reload();
//현제 웹페이지를 리로드함

location.href = 'location.href'
이또한 같다

'HTML 참고서 > HTML 생활코딩 Youtube' 카테고리의 다른 글

7. JavaScript 창제어  (0) 2020.04.12
6. JavaScript Navigator  (0) 2020.04.12
4.Javascript 객체  (0) 2020.04.10
3. JavaScript 사용자와 커뮤니케이션  (0) 2020.04.10
2. Java Script 구조에 대하여(HTML)  (0) 2020.04.10
블로그 이미지

Or71nH

,
블로그 이미지

Or71nH

,

### 알람 설정 alert

<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
    <input type="button" value="confirm" onclick="func_confirm()" />
    <script>
    	function func_confirm(){
        	if(confirm('ok?')){
            	alert('ok');
            } else {
                alert('cancel');
            }
        }
    </script>
                
    </body>
    

이것은 알람 선택을 할 수 있는 방법이다

 

### 로그인 설정 prompt

<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
    <input type="button" value="prompt" onclick="func_prompt()" />
    <script>
    	function func_prompt(){
        	if(prompt('id') === 'egoing'){
            	alert('welcome');
            } else {
                alert('fail');
            }
        }
    </script>
                
    </body>
    

로그인을 하는 방법의 기초이다

문자를 비교하여 맞는지 틀리는지 알려준다

 

 

 

 

'HTML 참고서 > HTML 생활코딩 Youtube' 카테고리의 다른 글

5.JavaScript Location  (0) 2020.04.12
4.Javascript 객체  (0) 2020.04.10
2. Java Script 구조에 대하여(HTML)  (0) 2020.04.10
1. HTML CSS 자바스크립트 로드 시키기  (0) 2020.04.10
선택만들기  (0) 2020.03.12
블로그 이미지

Or71nH

,
  • window 
    • DOM
      • document
    • BOM
      • navigator
      • screen
      •  
    • JaveScript
      • Object
      • Array

이렇게 윈도우 밑에 구성되있는 함수들의 구성위치자

이렇게 윈도우가 위에 있고 그밑에 애들이 있다

 

처음화면은 윈도우 바로 밑에 있다고 생각하면 된다

 

'HTML 참고서 > HTML 생활코딩 Youtube' 카테고리의 다른 글

4.Javascript 객체  (0) 2020.04.10
3. JavaScript 사용자와 커뮤니케이션  (0) 2020.04.10
1. HTML CSS 자바스크립트 로드 시키기  (0) 2020.04.10
선택만들기  (0) 2020.03.12
테이블 및 이미지  (0) 2020.03.12
블로그 이미지

Or71nH

,