border-style로 점선, 실선 등으로 설정 가능

당연(?) 하지만

top right bottom left 순서로 설정도 가능


[링크 : http://supervitamin.tistory.com/75]

'Programming > javascript & HTML' 카테고리의 다른 글

safari 날짜 계산 NaN 문제  (0) 2018.11.30
모바일 크롬 select-option  (0) 2018.11.30
브라우저 닫기, 창 이동시 이벤트  (0) 2018.11.30
javascript 변수 정확도  (0) 2018.11.26
js object array sort by key  (0) 2018.11.21
Posted by 구차니

jquery에서는 1.8 이후에 deprecated 되었고 3.0 이후에 완전 삭제 된 기능으로

.unload()가 존재하는데, 얘가 좀 직관적인 이름이긴 하다..

[링크 : https://api.jquery.com/unload/]


아무튼 document가 아니라 window에 대해서 before unload 이벤트를 등록하면

창을 이동하거나 닫거나 X 누를때(크롬에서 확인) 이벤트가 발생한다.

$(window).on("beforeunload", function() { 

    return confirm("Do you really want to close?"); 

}) 


[링크 : https://stackoverflow.com/questions/16707249/detect-close-windows-event-by-jquery]

[링크 : https://www.w3schools.com/jquery/event_unload.asp]

[링크 : http://suyou.tistory.com/86]


+

해보니.. 로그인 확인 누를때도 떠서 해제해줄 필요가 있네..

등록은 on() / bind()로 한다면

해제는 off() / unbind()로 한다.

//onBeforeUnload 이벤트 지정

$(window).bind('beforeunload', function()

{

    //페이지 변경이 있었는지 체크..

    var isChanged = ....; 


    //출력할 내용을 Return 해주면 확인 창이 뜨게 됩니다.

    if(isChanged) 

        return '변경된 사항이 있습니다. 페이지에서 나가시겠습니까?';<br>

    //확인 창을 띄우지 않으려면 아무 내용도 Return 하지 마세요!! (Null조차도)

};


//Form Submit 등 onBeforeUnload Event가 발생하길 원하지 않는 경우, 이벤트 해제

$('form').submit(function() 

{

    $(window).unbind('beforeunload'); 

}); 

[링크 : http://nsinc.tistory.com/101]

'Programming > javascript & HTML' 카테고리의 다른 글

모바일 크롬 select-option  (0) 2018.11.30
HTML border style 지정  (0) 2018.11.30
javascript 변수 정확도  (0) 2018.11.26
js object array sort by key  (0) 2018.11.21
wavesurfer.js 그리고 HE-AACv2  (0) 2018.11.21
Posted by 구차니

어쩌면 당연한건데.. 먼가 생소하게만 느껴지는 녀석



The maximum number of decimals is 17, but floating point arithmetic is not always 100% accurate:

Example

var x = 0.2 + 0.1;         // x will be 0.30000000000000004 

[링크 : https://www.w3schools.com/js/js_numbers.asp]

'Programming > javascript & HTML' 카테고리의 다른 글

HTML border style 지정  (0) 2018.11.30
브라우저 닫기, 창 이동시 이벤트  (0) 2018.11.30
js object array sort by key  (0) 2018.11.21
wavesurfer.js 그리고 HE-AACv2  (0) 2018.11.21
requireJS  (0) 2018.11.21
Posted by 구차니



[링크 : https://stackoverflow.com/questions/5467129/sort-javascript-object-by-key/31102605]


'Programming > javascript & HTML' 카테고리의 다른 글

브라우저 닫기, 창 이동시 이벤트  (0) 2018.11.30
javascript 변수 정확도  (0) 2018.11.26
wavesurfer.js 그리고 HE-AACv2  (0) 2018.11.21
requireJS  (0) 2018.11.21
[Violation] 'setInterval' handler took  (0) 2018.11.18
Posted by 구차니

크롬에서는 HE-AACv2를 지원하지 않는건가? edge는 되는데 머야...

Uncaught (in promise) DOMException: Unable to decode audio data


[링크 : https://bugs.chromium.org/p/chromium/issues/detail?id=409402]

[링크 : https://bugs.chromium.org/p/chromium/issues/detail?id=534301]

[링크 : https://github.com/katspaugh/wavesurfer.js/issues/703]

'Programming > javascript & HTML' 카테고리의 다른 글

javascript 변수 정확도  (0) 2018.11.26
js object array sort by key  (0) 2018.11.21
requireJS  (0) 2018.11.21
[Violation] 'setInterval' handler took  (0) 2018.11.18
JSON.stringify() 주의사항(?)  (0) 2018.11.17
Posted by 구차니

node.js 예제를 보다 보면

분명히(?) client side인데 require가 있어서 보는 중..

require.js로 JS들을 조건부 load 할 수 있다고 하는데...

[링크 : https://requirejs.org/docs/commonjs.html]


AMD는 Asynchronous Module Definition (비동기 모듈 정의) 규칙이다.

[링크 : https://blog.pigno.se/post/157992405313]



// EITHER - accessing modules with <script> tags

var WaveSurfer = window.WaveSurfer;

var TimelinePlugin = window.WaveSurfer.timeline;

var MinimapPlugin = window.WaveSurfer.minimap;


// OR - importing as es6 module

import WaveSurfer from 'wavesurfer.js';

import TimelinePlugin from 'wavesurfer.js/dist/plugin/wavesurfer.timeline.min.js';

import MinimapPlugin from 'wavesurfer.js/dist/plugin/wavesurfer.minimap.min.js';


// OR - importing as require.js/commonjs modules

var WaveSurfer = require('wavesurfer.js');

var TimelinePlugin = require('wavesurfer.js/dist/plugin/wavesurfer.timeline.min.js');

var MinimapPlugin = require('wavesurfer.js/dist/plugin/wavesurfer.minimap.min.js');


// ... initialising waveform with plugins

var wavesurfer = WaveSurfer.create({

    container: '#waveform',

    waveColor: 'violet',

    plugins: [

        TimelinePlugin.create({

            container: '#wave-timeline'

        }),

        MinimapPlugin.create()

    ]

}); 


[링크 : https://wavesurfer-js.org/doc/]

'Programming > javascript & HTML' 카테고리의 다른 글

js object array sort by key  (0) 2018.11.21
wavesurfer.js 그리고 HE-AACv2  (0) 2018.11.21
[Violation] 'setInterval' handler took  (0) 2018.11.18
JSON.stringify() 주의사항(?)  (0) 2018.11.17
canvas to input type=file formdata  (0) 2018.11.15
Posted by 구차니

걍 경고인가 문제가 있는건가.. 모르겠네


[링크 : https://forum.vuejs.org/t/how-to-debug-chrome-violation-message-handler-took/36928/2]


+

2018.11.19


"Chrome violations" don't represent Chrome bugs or app errors. They are warnings intended to help you improve your script. Here, Chrome is alerting you there's probably an opportunity to speed up your script.


("Violation" is arguably misleading terminology; what it really means is that the script violates a pre-defined guideline. These messages first appeared in Chrome in early 2017 and should ideally have a "More info" prompt to elaborate on the meaning and give suggested actions to the developer. Hopefully those will be added in the future.) 

[링크 : https://stackoverflow.com/.../javascript-chrome-violation-violation-handler-took-83ms-of-runtime]

'Programming > javascript & HTML' 카테고리의 다른 글

wavesurfer.js 그리고 HE-AACv2  (0) 2018.11.21
requireJS  (0) 2018.11.21
JSON.stringify() 주의사항(?)  (0) 2018.11.17
canvas to input type=file formdata  (0) 2018.11.15
jwt token ajax  (2) 2018.11.08
Posted by 구차니

+ 2018.11.19

걍.. stringify 하고 == 이렇게 비교한게 정상적으로 안되고

원래 배열을 == 로 비교하니 잘되는 희한한 문제..


그리고 코드에서 임시 객체는 삽입해 주었는데 그게 어떻게 내가 잘 못 이해해서

삽입전이거나 그렇게 비교해서 내부 객체를 안한걸로 보인거 같기도 한데

코드 변경해버려서 다시 보기도 귀찮...

---


JSON 객체 내부에 array가 있으면 얘는 별도로 stringify 해주지 않는다.

모지?


+

[링크 : https://medium.com/@cheonmyung0217/구현-json-stringify-를-재귀함수로-구현하기-972f08622562]


+

var a = {"a":"a","b":"b"}

undefined

a

{a: "a", b: "b"}

JSON.stringify(a)

"{"a":"a","b":"b"}"


var b = {"a":"a","b":"b","c":{"c":"c"}}

undefined

JSON.stringify(b)

"{"a":"a","b":"b","c":{"c":"c"}}"


var c = {"a":a,"b":b}

undefined

JSON.stringify(c)

"{"a":{"a":"a","b":"b"},"b":{"a":"a","b":"b","c":{"c":"c"}}}" 


'Programming > javascript & HTML' 카테고리의 다른 글

requireJS  (0) 2018.11.21
[Violation] 'setInterval' handler took  (0) 2018.11.18
canvas to input type=file formdata  (0) 2018.11.15
jwt token ajax  (2) 2018.11.08
js forEach 에서 다음 문장 실행하기  (0) 2018.11.08
Posted by 구차니

'Programming > javascript & HTML' 카테고리의 다른 글

[Violation] 'setInterval' handler took  (0) 2018.11.18
JSON.stringify() 주의사항(?)  (0) 2018.11.17
jwt token ajax  (2) 2018.11.08
js forEach 에서 다음 문장 실행하기  (0) 2018.11.08
js str2ip  (0) 2018.11.07
Posted by 구차니

흐음.. JWT를 써서 header에 박히면

window.localStrorage를 통해서 접근이 가능하다는데...

왜 안될까 ㅠㅠ


[링크 : https://stackoverflow.com/.../how-to-send-a-token-with-an-ajax-request-from-jquery/35870238]

Posted by 구차니