echarts.js:2286 Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload. echart init시킬 타겟 div의 width,height를 지정해주는게 아닌 타겟div를 감싸고있는 div의 width 및 height를 지정해줘야함!
오름차순 정렬 const arrayToSort = [ ['ft301b_ds', 'checked'], ['do200b_ds', 'checked'], ['err_a', 'checked'], ['ft2_ds', 'checked'], ['ft301_ds', 'checked'], ['err_b', 'checked'], ['ft102_ds', 'checked'], ['ft202_ds', 'checked'], ['srt_b', 'checked'], ]; // 첫 번째 요소([0])를 기준으로 정렬 arrayToSort.sort((a, b) => a[0].localeCompare(b[0])); console.log(arrayToSort); a는 자기자신 b는 비교할 다음 요소 내림차순 정렬 내림차순 정렬은 a랑 b의 ..
삼항연산자를 사용하면 null일때 false로 인식하여 널값 처리가 가능하다. 이후 위에서 처리한 형식으로 조건문 걸어서 continue처리하자 function setJson(data){ data.jsonAdminAuth.forEach(element => { let level = element.level let authlist = element.authlist ? element.authlist.split(',') : []; for(let i=0;i
에러 특정치 이상 올라가면 경보음 켜게하려고 // 경보음 소리파일 설정 let sirenSound = new Audio('../../../sound/sirensound.mp3'); // 노래 파일의 경로를 지정해야 합니다. function playSiren() { sirenSound.play(); } function pauseSiren() { sirenSound.pause(); } function siren(data){ if(data[0]>=data[1]){ playSiren() }else if(data[0]>=data[2]){ pauseSiren() } } 단순하게하면 될줄알았지만 무슨 크롬 정책때문에 powerMonitoring.js:2198 Uncaught (in promise) DOMExcepti..
$.ajax({ type: 'POST', url: '링크', data: JSON.stringify(Data), contentType:"application/json", //클라->서버 dataType:"json",// 서버->클라 success: function(res) { console.log(res) }, error : function(xhr,status,error) { //오류 발생 시 처리 }, complete:function(data,textStatus) { //작업 완료 후 처리 } }); } contentType 은 서버로 전송할때 보낼 데이터의 타입을 지정 dataType : 서버로부터 받을 데이터의 타입을 지정
사용되는곳에서 바로 전역변수로 적용되는 암묵적 전역변수 function aa(param){ jsondata = param; } function bb(){ aa('bbb') console.log(jsondata); } 함수aa를 보면 그어디에도let,const,var등을 이용해서 jsondata라는 변수를 선언한 적이 없지만 jsondata안에 값을 집어넣을 수 있다 이렇듯 javascript에서는 변수를 선언없이 바로 쓰게되면 자바스크립트에서 자동으로 해당 블럭내에서 전역변수를 생성하는데 예시를 다시 설명하자면 자동으로 aa함수 안에는 jsondata라는 이름의 전역변수가 생성되어지는 것이다 bb()함수 안에서 aa()를 호출했다 bb안에서는 jsondata를 선언한적이 없지만 aa()를 실행했기때문에 ..