๋ชฉ๋ก2022/01/28 (6)
whatisthis?
1) ๋ง์ฐ์ค ์ด๋ฒคํธ click ์์์ ๋ง์ฐ์ค๋ฅผ ํด๋ฆญํ์ ๋ dbclick ์์์ ๋ง์ฐ์ค๋ฅผ ๋๋ธํด๋ฆญํ์ ๋ mouseover ์์์ ๋ง์ฐ์ค๋ฅผ ์ค๋ฒํ์ ๋ (์ฌ๋ ค๋์์ ๋) mouseout ์์์ ๋ง์ฐ์ค๋ฅผ ์์ํ์ ๋ (๋ฐ๊นฅ์ผ๋ก) mousedown ์์์ ๋ง์ฐ์ค๋ฅผ ๋๋ ์ ๋ mouseup ์์์ ๋ง์ฐ์ค๋ฅผ ๋ผ์์ ๋ mousemove ์์์ ๋ง์ฐ์ค๋ฅผ ์์ง์์ ๋ contextmenu context menu(๋ง์ฐ์ค ์ฐํด๋ฆญ์ ๋์ค๋ ๋ฉ๋ด)๊ฐ ๋์ค๊ธฐ ์ wheel ํ ์ด ํ์ ๋์์ ๋ mouseleave ์ปค์๊ฐ ์์ ๋ฐ์ผ๋ก ๋ฉ๋ฆฌ ์ด๋ํ ๋ 2) ํค ์ด๋ฒคํธ keydown ํค๋ฅผ ๋๋ ์ ๋ keyup ํค๋ฅผ ๋ผ์์ ๋ keypress ํค๋ฅผ ๋๋ฅธ ์ํ์ผ ๋ 3) ํผ ์ด๋ฒคํธ focus ์์์ ํฌ์ปค์ค๊ฐ ์ด๋๋์์ ๋ blur ์..
๐ก JSON์ด๋? JavaScript Object Notation (JSON) ์ ์์ฑ-๊ฐ ์(attribute–value pairs / array data types (or any other serializable value)) ๋๋ "ํค-๊ฐ ์"์ผ๋ก ์ด๋ฃจ์ด์ง ๋ฐ์ดํฐ ์ค๋ธ์ ํธ๋ฅผ ์ ๋ฌํ๊ธฐ ์ํด ์ธ๊ฐ์ด ์ฝ์ ์ ์๋ ํ ์คํธ๋ฅผ ์ฌ์ฉํ๋ ๊ฐ๋ฐฉํ ํ์ค ํฌ๋งท. ์ธํฐ๋ท์์ ์๋ฃ๋ฅผ ์ฃผ๊ณ ๋ฐ์ ๋ ๊ทธ ์๋ฃ๋ฅผ ํํํ๋ ๋ฐฉ๋ฒ์ผ๋ก ์๋ ค์ ธ ์์. ์๋ฃ์ ์ข ๋ฅ์ ํฐ ์ ํ์ ์์ผ๋ฉฐ, ํนํ ์ปดํจํฐ ํ๋ก๊ทธ๋จ์ ๋ณ์๊ฐ์ ํํํ๋ ๋ฐ ์ ํฉํจ. ๋น๋๊ธฐ ๋ธ๋ผ์ฐ์ /์๋ฒ ํต์ (AJAX)์ ์ํด, ๋๊ฒ๋ XML(AJAX๊ฐ ์ฌ์ฉ)์ ๋์ฒดํ๋ ์ฃผ์ ๋ฐ์ดํฐ ํฌ๋งท. ** ์ฐธ๊ณ ใ ก ์ด์ ์ ๋ฐฐ์ ๋ ๋ด์ฉ ไธญ console.dir - element๋ฅผ JSO..
์คํ ์ปจํ ์คํธ (Execution Context) ์คํ ์ปจํ ์คํธ(Execution Context)๋ scope, hoisting, this, function, closure ๋ฑ์ ๋์์๋ฆฌ๋ฅผ ๋ด๊ณ ์๋ ์๋ฐ์คํฌ๋ฆฝํธ์ ํต์ฌ์๋ฆฌ์ด๋ค. var name = 'zero'; // ์ ์ญ๋ณ์ function wow(word) { // word๋ parameter console.log(word + ' ' + name); // } function say () { // var name = 'nero'; // ์ง์ญ๋ณ์ name ์ ์ธ console.log(name); // 'nero' wow('hello'); // console.log('hello zero') } say(); // nero, hello zero - Lexical..
์๋ฐ์คํฌ๋ฆฝํธ์์ ECMAscript 5 ์ด์ ์๋ var๋ก ์ ์ธํ ๋ณ์๋ก ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ์๋ค. (ECMA5์ดํ์๋ const์ let์ด ๋ฑ์ฅํ์๋ค. ํ์ฌ var์ ์ฌ๋งํด์ ์ฐ์ง X) var๋ก ์ ์ญ(global)๋ณ์๋ฅผ ๋ง๋๋ ๊ฒ์ ์ผ๊ฐ์ผ ํ๋ค! ๊ทธ๋ ๋ค๋ฉด, ์ ์ญ ๋ณ์๋ ๋ฌด์์ด๋ฉฐ, ์ผ๊ฐ์ผ ํ๋ ์ด์ ๋ ๋ฌด์์ผ๊น? ** ์ ์ญ๋ณ์ (global variable) ์๋ฐ์คํฌ๋ฆฝํธ์์ ๊ฐ์ฅ ๋ฐ๊นฅ ๋ฒ์(window ๊ฐ์ฒด)์ ๋ณ์๋ฅผ ๋ง๋๋ ๊ฒ. ํจ์ ์์ ํฌํจ๋์ง ์์. ์์ ๋ฅผ ํตํด ์ดํด๋ณด์. var x = 'global'; function ex() { var x = 'local'; x = 'change'; } ex(); // x๋ฅผ ๋ฐ๊ฟ๋ณธ๋ค. alert(x); // ์ฌ์ ํ 'global' ํจ์ ex ์์ x๋ local ๋ณ์(..
Object ๊ฐ์ฒด - object ์์ฒด๋ ๊ฐ์ฒด์ด๋ค. (๋ชจ๋ ๊ฐ์ฒด์ ์ต์ข prototype์) - ๊ฐ์ฒด์ prototype ํ์ธ >> ์ด๋ฏธ ๊ตฌํ๋ ๊ฐ์ฒด์ prototype์ ํ์ธํ๋ ค๋ฉด, __proto__๋ฅผ ์ฌ์ฉ. Math.__proto__; // Object { ... } ์๋ฅผ ๋ค์ด Math ๊ฐ์ฒด์ prototype์ ํ์ธํด๋ณด๋ฉด Object ๊ฐ์ฒด๊ฐ ๋์จ๋ค. ์ฆ, ๋ชจ๋ ๊ฐ์ฒด์ prototype์ ๊ฒฐ๊ตญ Object ๊ฐ์ฒด์ด๋ค. ** ์์ฑ์๋ก ๋ง๋ ๊ฐ์ฒด์ prototype์ prototype๋ Object ๊ฐ์ฒด๊ฐ ๋จ. function Person(name) { this.name = name; } Person.prototype.sayHello = function() { console.log(this.name); }..
javaScript. ์ซ์์ผ๊ตฌ๊ฒ์ - ์น ver. https://mywebproject.tistory.com/259?category=875338 javaScript. ์ซ์์ผ๊ตฌ๊ฒ์ - (2) javaScript. ์ซ์์ผ๊ตฌ๊ฒ์ -(1) Bulls and Cows (์ซ์์ผ๊ตฌ) - Rule - - ์ซ์ ์ ์ ํ์ : 10ํ ์ด๋ด - 4์๋ฆฌ์ ์ซ์๋ฅผ.. mywebproject.tistory.com ์ง๋ ํฌ์คํ ์์ ์ซ์์ผ๊ตฌ ๊ฒ์์ html์์์ eventListener์ ์ด์ฉํ์ฌ ํ๋ ์ดํ ์ ์๋๋ก ์์ ํ์๋ค. Guess ๋ฒํผ์ ๋๋ ์ ๋๋ฅผ ๊ธฐ์ค์ผ๋ก ํด๋ณด์๋๋ฐ, 1 / count๊ฐ ๋์ ์ด ์๋จ 2 / ๋๋ค ์ซ์๊ฐ ์ฐ๋์ด ์๋จ 3 / UI ๋์์ธ์ด ๋๋ฌด ์์ด์จ ๊ณผ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์๋ค. ํฐ ํ์ ์ ์งํ๋, ํฐํธ๋ ๊ธฐ๋ณธ..