728x90
๋ฐ˜์‘ํ˜•

jQuery 14

[jQuery] ์š”์†Œ์‚ญ์ œ

https://www.devkuma.com/docs/jquery/%EC%9A%94%EC%86%8C%EC%9D%98-%EC%82%AD%EC%A0%9C-remove--detach--empty--unwrap-/ jQuery ์ž…๋ฌธ | ์š”์†Œ์˜ ์กฐ์ž‘ | ์š”์†Œ์˜ ์‚ญ์ œ .remove() .detach() .empty() .unwrap() ์š”์†Œ์˜ ์‚ญ์ œ ๋‹ค์Œ ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์„ ํƒํ•œ ์š”์†Œ๋‚˜ ์ฝ˜ํ…์ธ ๋ฅผ ์‚ญ์ œํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ฉ”์†Œ๋“œ ์„ค๋ช… .remove() ์„ ํƒํ•œ ์š”์†Œ๋ฅผ DOM ํŠธ๋ฆฌ์—์„œ ์‚ญ์ œํ•œ๋‹ค. ์‚ญ์ œ๋œ ์š”์†Œ์™€ ์—ฐ๊ด€๋œ jQuery ๋ฐ์ดํ„ฐ๋‚˜ ์ด๋ฒคํŠธ๋„ ๊ฐ™์ด ์‚ญ www.devkuma.com .remove() ์„ ํƒํ•œ ์š”์†Œ๋ฅผ DOM ํŠธ๋ฆฌ์—์„œ ์‚ญ์ œํ•œ๋‹ค. (์‚ญ์ œ๋œ ์š”์†Œ์™€ ์—ฐ๊ด€๋œ jQuery ๋ฐ์ดํ„ฐ๋‚˜ ์ด๋ฒคํŠธ๋„ ๊ฐ™์ด ์‚ญ์ œ๋œ๋‹ค.) .detach() ..

Front/JS & jQuery 2023.04.29

[jQuery] ์„ ํƒ๋œ selectbox์˜ text ๊ฐ€์ ธ์˜ค๊ธฐ

$('text๋ฅผ ๋ถ™์ผ ๊ณณ์˜ ์„ ํƒ์ž').text($('selectbox์˜์„ ํƒ์ž option:selected').text()); option selected๋ฅผ ๋นผ๋ฉด selectbox์˜ ์ „์ฒด ์˜ต์…˜์˜ text๊ฐ’์ด ์„ ํƒ๋œ๋‹ค. .val()์„ ํ•˜๋ฉด text๊ฐ’์ด ์•„๋‹Œ option tag์˜ value๊ฐ’์ด ํ‘œ์‹œ๋œ๋‹ค.

Front/JS & jQuery 2022.08.16

[jQuery] $.extend()

jQuery.extend( ๋Œ€์ƒ, object1 [, objectN ] ) โœ… ๋‘˜ ์ด์ƒ์˜ ๊ฐœ์ฒด์˜ ๋‚ด์šฉ์„ ์ฒซ ๋ฒˆ์งธ ๊ฐœ์ฒด๋กœ ๋ณ‘ํ•ฉํ•ฉ๋‹ˆ๋‹ค. https://api.jquery.com/jquery.extend/ jQuery.extend() | jQuery API Documentation Description: Merge the contents of two or more objects together into the first object. When two or more object arguments are supplied to $.extend(), properties from all of the objects are added to the target object. Arguments that are null or ..

Front/JS & jQuery 2022.07.05

[jQuery] ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ (Event Handler) ๋ž€?

https://imswengineer.tistory.com/104 [jQuery] Event ์ผํšŒ์„ฑ ์ด๋ฒคํŠธ one( 'event' , data, ๋™์ž‘ํ•จ์ˆ˜) โžก๏ธ bind()์™€ ๋™์ผํ•˜์ง€๋งŒ ์ด๋ฒคํŠธ๊ฐ€ ํ•œ๋ฒˆ ์‹คํ–‰๋œํ›„ unbind()๋œ๋‹ค ๋งˆ์šฐ์Šค ์ด๋ฒคํŠธ - click : ๋งˆ์šฐ์Šค๋ฅผ ํด๋ฆญํ•  ๋•Œ ๋ฐœ์ƒ - dbclick : ๋งˆ์šฐ์Šค๋ฅผ ๋”๋ธ”ํด๋ฆญํ•  ๋•Œ ๋ฐœ์ƒ -. imswengineer.tistory.com event ์— ๋Œ€ํ•œ ์„ค๋ช…์„ ํ•ด๋†“์€ ํฌ์ŠคํŒ…์„ ๊ฐ™์ด ์ฒจ๋ถ€ํ•œ๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ์›นํŽ˜์ด์ง€๋ฅผ ์ด์šฉํ•  ๋•Œ ์ˆ˜๋งŽ์€ ์ด๋ฒคํŠธ๋“ค์ด ์กด์žฌํ•œ๋‹ค. ( ํด๋ฆญ, ๋งˆ์šฐ์Šค์˜ค๋ฒ„, ๊ธ€์„ ์ž…๋ ฅํ•˜๋Š” ๋“ฑ๋“ฑ... ) ์ด๋Ÿฌํ•œ ์ด๋ฒคํŠธ๋ฅผ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ event handler ( ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ )๋ผ๊ณ  ํ•œ๋‹ค. onclick() , onchange() ๋“ฑ๋“ฑ ์ด๋Ÿฌํ•œ..

Front/JS & jQuery 2022.06.13

[jQuery] .off() - ์ด๋ฒคํŠธ ํ•ด์ œํ•˜๊ธฐ

Syntax .off() .off( event ) .off( events [, selector ] ) .off( events [, selector ] [, handler ] ) โžก .off() ๋ฉ”์„œ๋“œ๋Š” ์—ฐ๊ฒฐ๋œ ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ๋ฅผ ์ œ๊ฑฐํ•œ๋‹ค. โžก + () ์•ˆ์— ํŠน์ • ์ด๋ฒคํŠธ๋ฅผ ์ž‘์„ฑํ•˜๋ฉด ํ•ด๋‹น ์ด๋ฒคํŠธ๋งŒ ์ œ๊ฑฐ๋œ๋‹ค. โžก + selector (์„ ํƒ์ž)๊นŒ์ง€ ์ž‘์„ฑํ•˜๋ฉด ํ•ด๋‹น ์„ ํƒ๋œ ์˜์—ญ์—์„œ ํ•ด๋‹น ์ด๋ฒคํŠธ๋งŒ ์ œ๊ฑฐ๋œ๋‹ค. โžก + handler๊นŒ์ง€ ์ ์–ด์ฃผ๋ฉด ํ•ด๋‹น ์„ ํƒ์˜์—ญ์˜ ํ•ด๋‹น์ด๋ฒคํŠธ๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  ์ƒˆ๋กœ์šด ์ด๋ฒคํŠธ๊ฐ€ ์‹คํ–‰๋œ๋‹ค. ์ฐธ์กฐ https://api.jquery.com/off/ .off() | jQuery API Documentation Description: Remove an event handler. The .off() method r..

Front/JS & jQuery 2022.06.12

[jQuery] .trigger('click') ๊ณผ .on('click')

.trigger('click') ๊ณผ .on('click')์˜ ์ฐจ์ด์ ์€ trigger๋Š” ํด๋ฆญ์ด๋ฒคํŠธ๋ฅผ ๊ฐ•์ œ๋กœ ์‹คํ–‰์‹œํ‚ค๋Š” ๊ฒƒ click๋ง๊ณ ๋„ ์—ฌ๋Ÿฌ๊ฐ€์ง€ event๋“ค์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. $(selector).trigger(event,eventObj,param1,param2,...) ๋‚ด๊ฐ€ ์ง์ ‘์‹คํ–‰ํ•˜์ง€ ์•Š์•„๋„ ๊ฐ•์ œ๋กœ ์ด๋ฒคํŠธ๊ฐ€ ์‹คํ–‰๋œ๋‹ค. https://www.w3schools.com/jquery/event_trigger.asp jQuery trigger() Method W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, ..

Front/JS & jQuery 2022.05.31

[jQuery] .forEach() , .each() ๋ฐ˜๋ณต๋ฌธ

var arr= [ {name : '์•Œ๋ฆฌ์†ก', backnumber : '1'} , {name : '๋ฐ˜๋‹ค์ดํฌ', backnumber : '4'} , {name : 'ํ”ผ๋ฅด๋ฏธ๋ˆ„', backnumber : '9'} , {name : '๋งˆ๋„ค', backnumber : '10'} , {name : '์‚ด๋ผ', backnumber : '11'} , {name : 'ํ—จ๋”์Šจ', backnumber : '14'} , {name : '์กฐํƒ€', backnumber : '20'} , {name : '๋ฃจ์ด์Šค๋””์•„์ฆˆ', backnumber : '23'} , {name : '์•„๋†€๋“œ', backnumber : '66'} ]; ์ผ๋ฐ˜ for๋ฌธ for (var i = 0; i

Front/JS & jQuery 2022.05.25

[Error][jQuery][datatables] datatables.bundle.js:9358 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode')

datatables๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค๋‹ค๊ฐ€ ์œ„์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋‚ฌ๋‹ค. ์›์ธ : columns์˜ data ๊ฐœ์ˆ˜ ( ์—ด์˜ ๊ฐœ์ˆ˜ )๊ฐ€ ๋งž์ง€ ์•Š์„ ๋•Œ โžก๏ธ ์ด ๊ฒฝ์šฐ๊ฐ€ ์ œ์ผ ๋งŽ์€ ๊ฑฐ ๊ฐ™๋‹ค. ๊ตฌ๊ธ€๋งํ•ด๋ณธ ๊ฒฐ๊ณผ ! ๋“ค์–ด์˜ค๋Š” ๋ฐ์ดํ„ฐ ๊ฐ’์ด ์—†์„ ๋•Œ ๋ฐ์ดํ„ฐ ๋ Œ๋”๋ง ๊ณผ์ •์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๋„ฃ์–ด์ฃผ๋Š” ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•˜์˜€๋‹ค. ,{ className : "txr", "targets" : [6, 7], render : function ( data, type, row ) { if (data) { data= data.toFixed(1); } else { data = 0; } return data+ '%'; }, tfoot : true, }

Error 2022.05.24
728x90
๋ฐ˜์‘ํ˜•