일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- evernote
- IOT
- npm moment
- 경동
- anydo
- 나비엔
- EditText
- 네모안
- 온도조절기
- 가스요금폭탄
- Raspberry Pi
- nodejs
- debounce
- 가스비절약
- todoist
- react-native
- 기름보일러
- rasppi3
- ReactNative
- 난방비절약
- REACT
- 린나이온도조절기
- Node
- __attribute__
- xcode11
- node.js
- 에버노트
- 라온익스
- Swipes
- 온도센서
- Today
- Total
목록개발/JavaScript (3)
어허
let myArray = ['a', 'b', 'c', 'd']; for(let i in myArray) { console.log(typeof i); } 결과 : string 당연시 int일 줄 알았는데 string이다. for(i=0; i for in과 for of의 차이 let myArray = ['a', 'b', 'c']; for(let i in myArray) { console.log(i); } // 결과 : 0,1,2 for(let i of myArray) { console.log(i); } // 결과 : a,b,c
DataTable 을 사용하다보면 ajax 에러가 나거나 행이나 열이 비었을 경우 warning을 띄워준다. alert로 띄워주기 때문에 end user가 에러를 그대로 보게 된다. 물론 이런 상황이 오지 않게 하는것이 바람직 하지만 상대방응답이 없을경우도 있을 것이기 때문에 end user에게 보여지는 것은 부담스럽다. 해서, 이 경고를 안보여 지게 할 수 있다 참조 링크 : https://datatables.net/manual/tech-notes/7 $.fn.dataTable.ext.errMode='throw'; 이렇게 하면 경고 메세지가 alert말고 브라우저의 console에 뜨게 된다. throw 대신 none을 쓰면 console에서도 보이지 않는다!
Node.js - Express 로 웹서버를 만들고 post 를 처리하는 과정에서 req.body에 넘어온 JSON 패킷을 사용하려다 보니 문제가 발생했다. >> client-sidefunction ajax_post(path, params){ $('#dbgRespJson').html(''); $.ajax({ url:path, dataType:'json', type:'POST', //data:{'msg':$('#send_msg').val()}, data:params, success:function(result){ dbg_log ( result ); g_RespJson = result['resp']; $('#dbgRespJson').html(g_RespJson); dbg_RespJson(JSON.parse(..