반응형

$http({

                        method: 'POST', //or GET

                        url: URL,

                        data: $.param({

                        }),

                        headers: {

                            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'

                        },

                        responseType: "blob"

                    }).success(function (response) {

                        

                        //이미지 지정

                        var urlCreator = window.URL || window.webkitURL;

                        var imageUrl = urlCreator.createObjectURL(response);

                        $('.img').attr("src", imageUrl);


                    }).finally(function () {

                    });

반응형

'FrontEnd > javascript' 카테고리의 다른 글

자바스크립트로 css생성 하기  (0) 2018.12.12
블로그 이미지

앱스페이스

,
반응형

var mySheet = document.styleSheets[0] 일때

 

if(!mySheet) {

    var stylesheet = document.createElement("style");

    stylesheet.setAttribute("type", "text/css");

    document.getElementsByTagName('head')[0].appendChild(stylesheet);

    mySheet = document.styleSheets[0];

}

반응형
블로그 이미지

앱스페이스

,