'2018/12/07'에 해당되는 글 5건

  1. 2018.12.07 미세먼지 크롤러 (다음, 네이버)
  2. 2018.12.07 git tag
  3. 2018.12.07 canvas dataURL to Formdata(file)
  4. 2018.12.07 node.js url encoding(?) 혹은 이스케이프
  5. 2018.12.07 오늘자 페미 기사 4
Programming/web 관련2018. 12. 7. 19:06

네이버랑 다음 지도에서 일단, 데이터 위치 특정하기


txt_num

[링크 : http://search.daum.net/search?nil_suggest=btn&w=tot&DA=SBC&q=미세먼지+종로구]


main_figure

[링크 : https://search.naver.com/search.naver?sm=top_hty&fbm=0&ie=utf8&query=미세먼지+종로구]

'Programming > web 관련' 카테고리의 다른 글

webGL vs SVG  (0) 2019.01.07
w3c validator  (0) 2018.12.10
edge browser mobile  (0) 2018.11.30
chrome 보안 무시  (0) 2018.11.13
REST API HTTP 에러코드  (0) 2018.11.06
Posted by 구차니

svn 이랑은 또 개념이 달라서 한참을 봐야 할듯..

걍 branch랑은 다르게 편하게 좀 쓸 수 있을것 같기도 하고..


[링크 : https://git-scm.com/book/ko/v1/Git의-기초-태그]

Posted by 구차니

근 두달만에 겨우 해결했네..

키워드를 잘 못 잡았던 걸까 싶긴한데

아무튼.. FileList() 객체로 생성되고 그랬던 거라.. 

File() 객체를 생성하는걸 생각 못한게 2달 날린(?) 원인.. ㅠㅠ



+

new File() 에는 Array가 첫번째 인자인걸 주의!!!!

(망할!!!!!)


var blobdata = document
.getElementById("target_obj_cnv")
.toDataURL("image/png");
blobdata = dataURLtoBlob(blobdata);
var imgFile2 = new File([blobToFile(blobdata, "target.png")], "target.png");
var data = new FormData();

data.append("image", imgFile2);

[링크 : https://stackoverflow.com/questions/27251953/how-to-create-file-object-from-blob[

[링크 : https://developer.mozilla.org/en-US/docs/Web/API/File/File]



+

걍 포기해야 하나? ㅠㅠ

[링크 : https://stackoverflow.com/questions/38449440/javascript-create-file-list-object-from-list-of-files]

[링크 : https://developer.mozilla.org/en-US/docs/Web/API/FileList]


+

으으.. 영 안되네.. ㅠㅠ


function blobToFile(theBlob, fileName) {
var date = new Date();
theBlob.lastModifiedDate = date;
theBlob.lastModified = date.getTime();
theBlob.name = fileName;
return theBlob;
}

function dataURLtoBlob(dataurl) {
var arr = dataurl.split(","),
mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]),
n = bstr.length,
u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], { type: mime });

} 

var blobdata = document
.getElementById("cnv")
.toDataURL("image/png");
blobdata = dataURLtoBlob(blobdata);
var imgFile2 = blobToFile(blobdata, "target.png");


[링크 : https://stackoverflow.com/questions/6850276/how-to-convert-dataurl-to-file-object-in-javascript]


+

Vanilla JavaScript


function blobToFile(theBlob, fileName){

    //A Blob() is almost a File() - it's just missing the two properties below which we will add

    theBlob.lastModifiedDate = new Date();

    theBlob.name = fileName;

    return theBlob;

[링크 : https://stackoverflow.com/questions/27159179/how-to-convert-blob-to-file-in-javascript/29390393]



---

[링크 : https://code.i-harness.com/ko-kr/q/4c46fc]


[링크 : https://teamtreehouse.com/community/how-to-create-a-file-from-a-dataurl-javascript]


var dataurl = canvas.toDataURL('image/jpeg',0.8);

var blob = dataURLtoBlob(dataurl);

var fd = new FormData();

fd.append("myFile", blob, "thumb.jpg"); 

[링크 : https://stackoverflow.com/questions/4998908/convert-data-uri-to-file-then-append-to-formdata]

[링크 : https://stackoverflow.com/questions/15675063/how-to-create-an-image-file-on-server-from-dataurl]

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

ajax success 콜백 사용하기  (0) 2018.12.15
js __proto__  (0) 2018.12.14
js 부모창 변수 접근하기  (0) 2018.12.04
크로스 브라우징 관련..  (0) 2018.11.30
wavesurfer.js HTML5 AUDIO 미지원시  (0) 2018.11.30
Posted by 구차니
Programming/node.js2018. 12. 7. 15:39

공백이 %20 으로 치환되는건 escape로도 되는거 같으니. 굳이 다른거 찾을 이유는 없는 듯..



$ node

> var qs = require('querystring');

undefined

> qs.unescape("http://localhost/api/sd?23 23 23")

'http://localhost/api/sd?23 23 23'

> qs.escape("http://localhost/api/sd?23 23 23")

'http%3A%2F%2Flocalhost%2Fapi%2Fsd%3F23%2023%2023'

> qs.escape("2002-02-22 22:22:22")

'2002-02-22%2022%3A22%3A22'


[링크 : http://blog.jeonghwan.net/2016/06/29/querystring-body-in-express.html]



+


javascript(client side) 에서 하는 법

var url = 'folder/index.html?param=#23dd&noob=yes'; //or specify one


var encodedUrl = encodeURIComponent(url);

console.log(encodedUrl);



var url = 'folder%2Findex.html%3Fparam%3D%2323dd%26noob%3Dyes'; //or specify one


var decodedUrl = decodeURIComponent(url);

console.log(decodedUrl); 


[링크 : https://www.sitepoint.com/jquery-decode-url-string]

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

node.js sso  (0) 2018.12.11
node.js rpi gpio  (0) 2018.12.08
node.js compressed http  (0) 2018.12.06
waveform-data.js  (0) 2018.11.30
node.js 혹은 sqlite?  (0) 2018.11.26
Posted by 구차니

여대생은 다 페미니스트여야 하나요?

[링크 : https://news.v.daum.net/v/20181207063126035]


모유수유 안하면 모진 엄마?..모성애 강요하는 사회

[링크 : https://news.v.daum.net/v/20181207063013015]

'개소리 왈왈 > 페미니즈음' 카테고리의 다른 글

맨박스가 없다고?  (2) 2018.12.27
기사 - '82년생 김지영'에 남자들은 거리 뒀다  (4) 2018.12.13
오늘의 늬우스  (0) 2018.12.03
대한민국의 미래가 안보이네  (4) 2018.11.16
백래시?  (2) 2018.10.17
Posted by 구차니