본문 바로가기

develop/java script22

날짜 포맷 dateFormat : function(date) { let dt = new Date(date); let yyyy = dt.getFullYear(); let mm = String(dt.getMonth() + 1); let dd = String(dt.getDate()); return String(yyyy) +'-'+ String(mm[1]?mm:'0'+mm[0])+'-'+String(dd[1]?dd:'0'+dd[0]); } 2021. 2. 25.
js 테이블 병합 function genRowspan(className){ $("." + className).each(function() { let rows = $("." + className + ":contains('" + $(this).text() + "')"); if (rows.length > 1) { rows.eq(0).attr("rowspan", rows.length); rows.not(":eq(0)").remove(); } }); } 2020. 6. 18.
ES6 https://jsdev.kr/t/es6/2944 2020. 5. 25.
jquery 배열 object 삭제 ntfc.param.downList = []; ntfc.param.downList = $.grep(ntfc.param.downList, function (item) { return item.atchmnflSn.toString() !== atchDtaSn.toString(); }); ntfc.param.downList에 return 이 true인것만 남고 false인것은 제외된다. 2020. 5. 21.
ajax 패턴 Examples:Save some data to the server and notify the user once it's complete.12345678$.ajax({ method: "POST", url: "some.php", data: { name: "John", location: "Boston" }}) .done(function( msg ) { alert( "Data Saved: " + msg ); });Retrieve the latest version of an HTML page.1234567$.ajax({ url: "test.html", cache: false}) .done(function( html ) { $( "#results" ).append( html ); });Send an xml doc.. 2018. 12. 20.
Google javascript style guide Google javascript style guidehttps://www.vobour.com/%EA%B5%AC%EA%B8%80%EC%9D%80-%EC%9E%90%EB%B0%94-%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8-%EC%8A%A4%ED%83%80%EC%9D%BC-%EA%B0%80%EC%9D%B4%EB%93%9C%EB%A5%BC-%EB%B0%9C%ED%96%89-%ED%95%A9%EB%8B%88%EB%8B%A4-%EB%8B%A4%EC%9D%8C%EC%9D%80-%EB%AA%87-%EA%B0%80%EC%A7%80-%ED%95%B5%EC%8B%AC https://google.github.io/styleguide/jsguide.html 2018. 4. 5.