ajax로 formdata 보내기

[링크 : https://www.mkyong.com/jquery/jquery-ajax-submit-a-multipart-form/]



생성하기

[링크 : https://developer.mozilla.org/ko/docs/Web/API/FormData/FormData]


보는거 무지 복잡하네..

var formData = new FormData();

formData.append('key1', 'value1');

formData.append('key2', 'value2');


// Display the key/value pairs

for (var pair of formData.entries()) {

    console.log(pair[0]+ ', ' + pair[1]); 

[링크 : https://stackoverflow.com/questions/17066875/how-to-inspect-formdata]


+

var formData = new FormData();


formData.append('items', new Blob([JSON.stringify({

    name: "Book",

    quantity: "12"

})], {

    type: "application/json"

})); 

[링크 : https://stackoverflow.com/...multipart-form-data-with-a-different-content-type-on-each-parts-with-j]


+

var st = imagepath.replace(data:image/png or jpg; base64"/""); 

[링크 : https://stackoverflow.com/questions/22172604/convert-image-url-to-base64]

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

canvas to blob  (2) 2018.10.25
자바스크립트 base64 인코딩, 디코딩  (0) 2018.10.24
js toHexString()  (0) 2018.10.23
jsmpeg div로 사용시 옵션  (0) 2018.10.18
js setinterval  (0) 2018.10.16
Posted by 구차니

나보다 나이 많으실 아날로그 테스터기를 보내드리고 하나 사야겠다.

돈 많으면 fluke 라던가 좀 좋은거 사고 싶지만.. 흑...

건전지 전압 체크용으로 하나 사야지

(오프라인으로 사려니 2~3만원 급이라 ㅠㅠ)


[링크 : http://itempage3.auction.co.kr/DetailView.aspx?itemno=B585323105]

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

애들 다 재우고..  (2) 2018.11.10
내 하루 어디갔어..  (2) 2018.11.04
단풍이 절정이라는데..  (2) 2018.10.20
회사 워크샾 - 에버랜드  (3) 2018.10.08
9월의 끝  (2) 2018.09.30
Posted by 구차니
Programming/jquery2018. 10. 23. 17:16

포인트(?)는 ajax에서 return $.ajax()를 해주어야 한다는 것


$.when(ajax1(), ajax2(), ajax3(), ajax4()).done(function(a1, a2, a3, a4){

    // the code here will be executed when all four ajax requests resolve.

    // a1, a2, a3 and a4 are lists of length 3 containing the response text,

    // status, and jqXHR object for each of the four ajax calls respectively.

});


function ajax1() {

    // NOTE:  This function must return the value 

    //        from calling the $.ajax() method.

    return $.ajax({

        url: "someUrl",

        dataType: "json",

        data:  yourJsonData,            

        ...

    });

[링크 : https://stackoverflow.com/questions/3709597/wait-until-all-jquery-ajax-requests-are-done]

'Programming > jquery' 카테고리의 다른 글

jquery selector와 document.getElementById 차이  (0) 2018.11.05
jquery trigger()  (0) 2018.10.25
jquery ajax data, header  (0) 2018.10.23
jquery shake  (0) 2018.10.16
jquery ani arc  (0) 2018.10.16
Posted by 구차니
Programming/jquery2018. 10. 23. 16:38

get의 header로 보낼때는 header 인가..

post의 body는 data


[링크 : https://stackoverflow.com/questions/3258645/pass-request-headers-in-a-jquery-ajax-get-call]

'Programming > jquery' 카테고리의 다른 글

jquery selector와 document.getElementById 차이  (0) 2018.11.05
jquery trigger()  (0) 2018.10.25
jqeury ajax 수행 완료 기다리기  (0) 2018.10.23
jquery shake  (0) 2018.10.16
jquery ani arc  (0) 2018.10.16
Posted by 구차니

원래 이런건 지원안해서 직접 만들어야 하나보네..


function toHexString(byteArray) {

  return Array.from(byteArray, function(byte) {

    return ('0' + (byte & 0xFF).toString(16)).slice(-2);

  }).join('')

[링크 : https://stackoverflow.com/questions/34309988/byte-array-to-hex-string-conversion-in-javascript]

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

자바스크립트 base64 인코딩, 디코딩  (0) 2018.10.24
formdata dump  (0) 2018.10.24
jsmpeg div로 사용시 옵션  (0) 2018.10.18
js setinterval  (0) 2018.10.16
ajax each  (0) 2018.10.16
Posted by 구차니
Programming/C Win32 MFC2018. 10. 23. 09:57

귀찮으니 그냥 str* 으로 대충 짤까..

[링크 : https://dojang.io/mod/page/view.php?id=724]


+

적합성(?) 테스트 한 자료가 있어서 링크 복사

[링크 : http://jhhwang4195.tistory.com/94]

'Programming > C Win32 MFC' 카테고리의 다른 글

strptime  (0) 2021.02.17
while(-1) 이 될까?  (0) 2019.05.24
uuid in c  (0) 2018.10.22
엔디안 급 멘붕..  (0) 2018.05.29
const char *과 char * const 차이  (0) 2018.01.31
Posted by 구차니
개소리 왈왈/컴퓨터2018. 10. 22. 19:21

갑자기 펜이 인식이 안되거나

갑자기 흘려쓰기로 써진다거나(펜이 계속 눌림)

한번 인식 안되면 살아나지 않아서 배터리 뽑았다 꽂아야 한다거나


하는 증상이 다시 발생

아.. 배터리 다 된건가?


[링크 : https://www.clien.net/service/board/use/9083975]

[링크 : http://data.energizer.com/pdfs/ind-6lr61pl_eu.pdf]

[링크 : https://www.dell.com/.../microsoft-surface-pro-4-sp4-스타일러스-배터리-수명-및-문제-해결?lang=ko]

[링크 : http://bbs.ruliweb.com/hobby/board/300010/read/1033974]


+

딱 두달 전 인가..

출퇴근 한시간 반 * 2= 3시간 정도 씩 주 5일 사용한거 같은데 2달 버티다니...

2018/08/23 - [개소리 왈왈/컴퓨터] - 서피스 프로 3 펜 AAAA 배터리 획득(?!)

Posted by 구차니
Programming/node.js2018. 10. 22. 17:38

typeof를 이용해서 undefined 와 비교하면 됨

(req.body나 req.param 로 들어오는 녀석들 값 있는지 존재여부 비교하기 용)


if (typeof query !== 'undefined' && query !== null){

   doStuff();

[링크 : http://misoin.tistory.com/53]

[링크 : https://stackoverflow.com/.../how-can-i-check-whether-a-variable-is-defined-in-node-js]


+

2018.10.23

써보니. undefined는 변수로 사용되는 reserved keyword가 아니다

즉, "undefined"나 'undefined'와 비교를 해주어야 한다.

'Programming > node.js' 카테고리의 다른 글

curl jwt  (0) 2018.10.26
node-rtsp-stream 과 node-rtsp-stream-es6 차이  (0) 2018.10.24
node.js를 이용한 자기 자신의 ip 얻기  (4) 2018.10.22
웹소켓 그리고 공유기?  (4) 2018.10.18
node-rtsp-stream의 pid 얻기  (0) 2018.10.18
Posted by 구차니

머.. 거장한것 없이 프로젝트 최상위 폴더에

.gitignore로 생성하고

상위 폴더 경로나 특정 파일명 혹은 *을 포함해서 적어주면 된다.


[링크 : https://nesoy.github.io/articles/2017-01/Git-Ignore]


+

vscode에서 최상위 프로젝트 파일에다가 설정해주니 하위에서도 정상적으로 gitignore가 적용된다.

걍.. 폴더로 무시하는게 답이었던 듯..

$ cat .gitignore

node_modules/ 

[링크 : http://trend21c.tistory.com/1471]

Posted by 구차니
개소리 왈왈/컴퓨터2018. 10. 22. 15:45

HDMI-in 이라고 되어있어서 무언가 좋은 기능인줄 알고 찾아봤는데

대놓고 무쓸모 -_-


일단.. 하스웰 내장 그래픽 카드를 쓰고

외부 모니터를 HDMI로 연결하고(메뉴얼에 의하면)

다른 HDMI source를 받아서 alt-c 등의 미리 등록된 단축키를 사용하여

메인보드에서 HDMI selector 역활을 해주는 녀석

전원 꺼도 상관없다지만 정확하게는 S5 절전상태고 완전 전원 뽑은 상태에서는 안되는 기능


메인보드로 입력하길래 HDMI 캡쳐라던가 동영상 저장 기능이라도 있을줄 알았는데 그것도 아니고

내장 그래픽 소켓으로만 된다니 대실망쇼~


[링크 : https://www.youtube.com/watch?v=wivYGt_SIg8]

[링크 : http://www.asrock.com/news/index.asp?cat=News&ID=1274]

[링크 : https://www.asrock.com/mb/Intel/Z87%20OC%20Formula/]


1. If there is no video displayed on your monitor, make sure that the cables are properly connected and make sure that “Deep S5” option in BIOS SETUP is set to [Disable]. 2. If required, connect a power source to the adapter that lets the smartphone/tablet output HDMI signal 

[링크 : http://asrock.pc.cdn.bitgravity.com/Manual/Z87%20OC%20Formula.pdf]


+

메인보드 설계상 HDMI in 1채널과 HDMI out 1채널이니까

CPU 쪽 HDMI 출력과 HDMI in 출력을

USB 키보드 입력에 따라서 단순하게 전환해주면 되는 기술..

단지, HDMI 셀렉터의 버튼을 키보드로 치환했을 뿐인 용도 불명의 기술.. -_-

Posted by 구차니