javascript2 [Bootstrap] modal ๋ฆฌ์ฌ์ด์ง, ์ด๋, ์ ์ฒดํ๋ฉด JQuery ๋ถํธ์คํธ๋ฉ ๋ชจ๋ฌ์ ๋ฆฌ์ฌ์ด์ง ๊ธฐ๋ฅ ์ถ๊ฐ, ๋ชจ๋ฌ์ ํค๋ ๋๋ธํด๋ฆญ ์ ์ ์ฒดํ๋ฉด ๊ธฐ๋ฅ ๊ตฌํ // ๋ชจ๋ฌ ๋ถํธ์คํธ๋ฉ ์ด๊ธฐ์ค์ + ์คํ function modalInitSetOpen($modal,nextOpen = true){ // ๋ชจ๋ฌ ์์ฑ ์ธํ --------------------------------------------------------------- if(!window['cpn_modal_dblclick']){ window['cpn_modal_dblclick'] = {}; }else{ window['cpn_modal_dblclick'][$modal[0].id] = undefined; } // ๊ธฐ๋ณธ ์ค์ ---------------------------------------------------.. 2020. 11. 19. [JavaScript] ํด๋ก์ (Closure) ํด๋ก์ (Closure)๋? - MDN์์์ ์ ์ ํด๋ก์ ๋ ๋ ๋ฆฝ์ ์ธ (์์ ) ๋ณ์๋ฅผ ๊ฐ๋ฆฌํค๋ ํจ์์ด๋ค. ๋๋, ํด๋ก์ ์์ ์ ์๋ ํจ์๋ ๋ง๋ค์ด์ง ํ๊ฒฝ์ ‘๊ธฐ์ตํ๋ค’. “A closure is the combination of a function and the lexical environment within which that function was declared.” ํด๋ก์ ๋ ํจ์์ ๊ทธ ํจ์๊ฐ ์ ์ธ๋์ ๋์ ๋ ์์ปฌ ํ๊ฒฝ(Lexical environment)๊ณผ์ ์กฐํฉ์ด๋ค. ํด๋ก์ ๋ ๋จ์ํ ํจ์ ์ธ๋ถ์ ๋ณ์์ ์ ๊ทผ ๊ฐ๋ฅํ ๋ด๋ถ ํจ์๊ฐ ์๋๋ค. ํจ์ ์คํ์ ์ธ๋ถ ๋ณ์ ์ ๊ทผ์ ์ํด, ํจ์๊ฐ ์ ์ธ๋ ๋ ๋ฉ๋ชจ๋ฆฌ์ ์ ์ฅ๋๋ ๊ฐ์ฒด์ด๋ค. function outFunc(){ var reason = "test"; var v.. 2020. 11. 13. ์ด์ 1 ๋ค์