๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ˜์‘ํ˜•

๊ฐœ๋ฐœ/JavaScript2

[JavaScript] var, let, const ๋น„๊ต - var is used instead of let or const ์ธํ…”๋ฆฌ์ œ์ด๋ฅผ ์ž‘๋…„์— ์ฒ˜์Œ ์‚ฌ์šฉํ•ด๋ดค๋Š”๋ฐ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ฐœ๋ฐœํ•  ๋•Œ ํ‰์†Œ์ฒ˜๋Ÿผ var์„ ์‚ฌ์šฉํ–ˆ๋”๋‹ˆ'var is used instead of let or const' ๋ผ๋Š” ๋ฉ”์‹œ์ง€๊ฐ€ ๋ณด์—ฌ์กŒ๋‹ค. ๋ฉ”์‹œ์ง€๋ฅผ ๋ฒˆ์—ญํ•ด๋ณด๋ฉด 'var'๋Œ€์‹  'let'์ด๋‚˜ 'const'๋ฅผ ์‚ฌ์šฉํ•˜๋ผ๋Š” ๊ฒƒ์ด๋‹ค. sts๋ฅผ ์‚ฌ์šฉํ•  ๋• ์ €๋Ÿฐ ๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜์˜ค์ง€ ์•Š์•˜๋Š”๋ฐ ์™œ 'var'๋Œ€์‹  'let'์ด๋‚˜ 'const'๋ฅผ ์‚ฌ์šฉํ•˜๋ผ๋Š”๊ฑด์ง€ ์„œ์น˜ํ•ด๋ณด์•˜๋‹ค! es6๋ถ€ํ„ฐ๋Š” var๋Œ€์‹  ์ƒˆ๋กœ์šด ๋ณ€์ˆ˜ ์„ ์–ธ ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ฌผ๋ก  var์‚ฌ์šฉ์„ ๋ชปํ•˜๋Š” ๊ฑด ์•„๋‹ˆ์ง€๋งŒ ์ธํ…”๋ฆฌ์ œ์ด์—์„œ ์ƒˆ๋กœ์šด ํ‘œ์ค€์— ๋งž๊ฒŒ ๊ฐœ๋ฐœํ•˜๋ผ๋Š” ๊ฒฝ๊ณ  ๋ฉ”์‹œ์ง€๋ฅผ ๋„์–ด์ฃผ๋Š” ๊ฒƒ์ด๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ตœ๊ทผ์˜ ๋งŽ์€ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๊ฐ•์ขŒ์—์„œ๋„ ๊ฐ€๊ธ‰์  var ๋Œ€์‹ ์— let์ด๋‚˜ const ํ‚ค์›Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ณ€์ˆ˜๋ฅผ ์„ ์–ธํ•˜๋ผ๊ณ  ๊ฐ€์ด๋“œํ•˜๊ณ  ์žˆ๋‹ค๊ณ .. 2022. 1. 24.
[Ajax] ํŒŒ์ผ file ๋‹ค์šด๋กœ๋“œ ๋ฐ›๊ธฐ ๊ฒฐ๋ก ๋ถ€ํ„ฐ ๋งํ•˜์ž๋ฉด xhr.responseType = "blob" ๋กœ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค! ๊ธฐ์กด์— ์‚ฌ์šฉํ•˜๋˜ ์ œ์ด์ฟผ๋ฆฌ ๋ฒ„์ „์ด 1.11.1์ด์˜€๋Š”๋ฐ ์ด ๋ฒ„์ „์€ blob์ด ์ ์šฉ์•ˆ๋˜๋”๋ผ.. ๋ฒ„์ „ ๋ฌธ์ œ์ธ์ค„ ๋ชจ๋ฅด๊ณ  ํ•œ์ฐธ์„ ์”จ๋ฆ„ ํ–ˆ๋Š”๋ฐ 3.6.0์œผ๋กœ ์˜ฌ๋ฆฌ๋‹ˆ๊นŒ ํ•ด๊ฒฐ๋๋‹ค. (์–ด๋–ค ๋ฒ„์ „๋ถ€ํ„ฐ ๋˜๋Š” ๊ฑด์ง€๋Š” ๋ชจ๋ฅด๊ฒ ์Œ) ์•„๋ž˜ ์˜ˆ์‹œ ์ฐธ์กฐ!! let options = { url: "[[@{/}]]download" , beforeSubmit : loadingAjaxImage , contentType: "application/x-www-form-urlencoded;charset=UTF-8" , xhr: function () { let xhr = new XMLHttpRequest(); xhr.onreadystatechange = function .. 2021. 11. 30.
728x90
๋ฐ˜์‘ํ˜•