본문 바로가기
728x90
반응형

JavaScript17

JavaScript] DOM Navigation 출처 : https://javascript.info/dom-navigation 원하는 element를 수정하기 위해서는 해당하는 DOM object가 필요하다. DOM의 모든 동작은 document object와 시작한다. 이로부터 어떠한 node에도 접근할 수 있다. On top: documentElement and body 최상단 3개의 document properties가 있다. = document.documentElement = document.body Children: childNodes[nodenumber], firstChild, lastChild Child nodes (or children) - direct children인 elements. 예를들어 , 는 element의 children이.. 2022. 11. 3.
JavaScript] DOM tree 출처 : https://javascript.info/dom-nodes HTML document의 뼈대는 tags이다. Document Object Model (DOM)에 따르면, 모든 HTML tag는 object이다. enclosing tag에 포함된 tags는 children이다. tag 내부의 text 또한 object이다. 이러한 모든 objects는 JavaScript를 통해서 접근이 가능하며, 이를 활용해 page를 수정할 수 있다. 예를들어 document.body는 tag를 나타내는 object이다. 아래 코드를 실행하면 3초간 red로 변경할 수 있다. document.body.style.background = 'red'; // make the background red setTimeou.. 2022. 11. 3.
JavaScript] Browser environment, DOM, BOM 출처 : https://javascript.info/browser-environment Browser environment, specs JavaScript는 처음에 웹 브라우저를 위해 만들어졌다. 따라서 많은 활용과 플랫폼과 함께 발전하였다. browser, web-server, 또다른 host와 같은 platform이다. 각각은 특화된 platform 기능을 제공한다. 이것을 host environment라고 칭한다. host environment는 language core뿐만 아니라 자신의 objects, function을 제공한다. 아래는 web browser에서 JavaScript가 실행될때 갖는 것들의 조감도이다. window라 불리는 root object가 있다. 2가지 역할이 있다. Java.. 2022. 11. 3.
JavaScript] 웹에서 Apple Login 구성하기 Apple Developer Documentation : https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/configuring_your_webpage_for_sign_in_with_apple 참조 : https://sarunw.com/posts/sign-in-with-apple-4/ 1. Apple Developer 에 로그인 https://developer.apple.com/account 2. Certificates, Identifiers & Profiles 메뉴에서 Service ID 설정한다. 자세한 내용은 아래 참조 https://help.apple.com/developer-account/#/dev.. 2021. 10. 13.
Object.keys(), Object.values(), Object.entries() Object를 Array로 변환하는 메서드들에 대해 알아보자. Object.keys() : object의 property names을 배열로 반환 const object1 = { a: 'somestring', b: 42, c: false }; console.log(Object.keys(object1)); // expected output: Array ["a", "b", "c"] Object.keys(object1).map(key => ( console.log(key) )) output : > Array ["a", "b", "c"] > "a" > "b" > "c" Object.values() : object의 property values을 배열로 반환 const object1 = { a: 'somestri.. 2020. 10. 14.
728x90
반응형